2

I try to build project by using musl

In Dockerfile i have

FROM golang:1.17

......Some instructions

RUN : \
    && wget -O /tmp/musl-1.1.19.tar.gz http://www.musl-libc.org/releases/musl-1.1.19.tar.gz \
    && tar -xvf /tmp/musl-1.1.19.tar.gz -C /tmp \
    && cd /tmp/musl-1.1.19 \
    && ./configure \
    && make \
    && make install \
    && cd - \
    && rm -rf /tmp/musl-1.1.19 /tmp/musl-1.1.19.tar.gz \
    ;

......Some instructions

RUN : \
    && CC=/usr/local/musl/bin/musl-gcc go build --ldflags '-s -w -linkmode external -extldflags "-static"' \
    && mv my-awesome-project /usr/local/bin/my-awesome-project

And i got Error : against hidden symbol `__TMC_END__' can not be used when making a PIE object collect2

It`s work as well in golang:1.9 image.

Also i tryed to install musl-tools by apt-get install, same result...

I not understand what i doing wrong and what exactly compiler want from me.

DeYuro
  • 65
  • 5
  • 1
    Some information about your source will be needed here. Some C code in your CGO is referencing `__TMC_END__` which is not allowed when compiling a PIE (position independent executable). musl compiles PIE by default, which libc does not. – Bracken Nov 25 '21 at 12:11
  • np but which one? Project is entrypoint for docker which allow to pass arg via double dash. For fpm start as example, also it use remote packages as "github.com/robfig/cron" for cron and "github.com/miekg/dns" for resolve via dns cache – DeYuro Nov 25 '21 at 12:56

0 Answers0