Closed BlackDogLi closed 6 months ago
So what is it, Centos or Alpine? What is the compiler in /home/opt/compiler, is it a musl gcc? It looks like you are trying to compile for musl using plain gcc. You have examples in issues of how to build for Alpine and Musl.
Right, so I just tested, you must use musl gcc if you want to build for musl, i.e:
go build -tags musl
# example
/usr/lib/go/pkg/tool/linux_amd64/link: running x86_64-pc-linux-gnu-gcc failed: exit status 1
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/milann/.cache/go/mod/github.com/gen2brain/go-fitz@v1.23.7/libs/libmupdf_linux_amd64_musl.a(buffer.o): in function `fz_new_buffer':
buffer.c:(.text.fz_new_buffer+0x47): undefined reference to `sigsetjmp'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/milann/.cache/go/mod/github.com/gen2brain/go-fitz@v1.23.7/libs/libmupdf_linux_amd64_musl.a(buffer.o): in function `fz_new_buffer_from_data':
buffer.c:(.text.fz_new_buffer_from_data+0x27): undefined reference to `sigsetjmp'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/milann/.cache/go/mod/github.com/gen2brain/go-fitz@v1.23.7/libs/libmupdf_linux_amd64_musl.a(buffer.o): in function `fz_new_buffer_from_base64':
buffer.c:(.text.fz_new_buffer_from_base64+0xeb): undefined reference to `sigsetjmp'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/milann/.cache/go/mod/github.com/gen2brain/go-fitz@v1.23.7/libs/libmupdf_linux_amd64_musl.a(colorspace.o): in function `fz_cached_color_convert':
colorspace.c:(.text.fz_cached_color_convert+0x9f): undefined reference to `sigsetjmp'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/milann/.cache/go/mod/github.com/gen2brain/go-fitz@v1.23.7/libs/libmupdf_linux_amd64_musl.a(colorspace.o): in function `fz_new_colorspace':
colorspace.c:(.text.fz_new_colorspace+0x6f): undefined reference to `sigsetjmp'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/milann/.cache/go/mod/github.com/gen2brain/go-fitz@v1.23.7/libs/libmupdf_linux_amd64_musl.a(colorspace.o):colorspace.c:(.text.fz_new_icc_colorspace+0x76): more undefined references to `sigsetjmp' follow
collect2: error: ld returned 1 exit status
CC=x86_64-pc-linux-musl-gcc go build -tags musl
file example
example: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, Go BuildID=uBMxLYbblufj-uelQYGh/9CWUatp-5ceiXax-Q6BM/kfblecrTQjl1tydrm8--/6BbPjkjOoNv3cPP-LWK1, with debug_info, not stripped
So what is it, Centos or Alpine? What is the compiler in /home/opt/compiler, is it a musl gcc? It looks like you are trying to compile for musl using plain gcc. You have examples in issues of how to build for Alpine and Musl.
centos
could i use musl gcc for centos image. like RUN yum install -y gcc musl-dev
?
Sorry, no idea, try it.
fz_new_buffer': [2024-04-12 15:54:42] buffer.c:(.text.fz_new_buffer+0x47): undefined reference to
sigsetjmp' [2024-04-12 15:54:42] /home/opt/compiler/gcc-8.2/gcc-8.2/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /root/go/pkg/mod/github.com/gen2brain/go-fitz@v1.20.1/libs/libmupdf_linux_amd64_musl.a(buffer.o): in functionfz_new_buffer_from_data': [2024-04-12 15:54:42] buffer.c:(.text.fz_new_buffer_from_data+0x27): undefined reference to
sigsetjmp' [2024-04-12 15:54:42] /home/opt/compiler/gcc-8.2/gcc-8.2/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /root/go/pkg/mod/github.com/gen2brain/go-fitz@v1.20.1/libs/libmupdf_linux_amd64_musl.a(buffer.o): in functionfz_new_buffer_from_base64': [2024-04-12 15:54:42] buffer.c:(.text.fz_new_buffer_from_base64+0xf6): undefined reference to
sigsetjmp' [2024-04-12 15:54:42] /home/opt/compiler/gcc-8.2/gcc-8.2/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /root/go/pkg/mod/github.com/gen2brain/go-fitz@v1.20.1/libs/libmupdf_linux_amd64_musl.a(colorspace.o): in functionfz_cached_color_convert': [2024-04-12 15:54:42] colorspace.c:(.text.fz_cached_color_convert+0xa0): undefined reference to
sigsetjmp' [2024-04-12 15:54:42] /home/opt/compiler/gcc-8.2/gcc-8.2/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /root/go/pkg/mod/github.com/gen2brain/go-fitz@v1.20.1/libs/libmupdf_linux_amd64_musl.a(colorspace.o): in functionfz_new_colorspace': [2024-04-12 15:54:42] colorspace.c:(.text.fz_new_colorspace+0x6f): undefined reference to
sigsetjmp' [2024-04-12 15:54:42] /home/opt/compiler/gcc-8.2/gcc-8.2/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /root/go/pkg/mod/github.com/gen2brain/go-fitz@v1.20.1/libs/libmupdf_linux_amd64_musl.a(colorspace.o):colorspace.c:(.text.fz_new_icc_colorspace+0x76): more undefined references to `sigsetjmp' follow