Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling on alpine docker images (musl libc) #31

Open
prcastro opened this issue Jul 5, 2024 · 0 comments
Open

Error when compiling on alpine docker images (musl libc) #31

prcastro opened this issue Jul 5, 2024 · 0 comments

Comments

@prcastro
Copy link
Contributor

prcastro commented Jul 5, 2024

I'm getting the following error when compiling on alpine:

/usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::init::sanitize_standard_fds':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/mod.rs:160:(.text._ZN3std2rt19lang_start_internal17hea39f29bda0ceae5E+0xac): undefined reference to `open64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/mod.rs:160:(.text._ZN3std2rt19lang_start_internal17hea39f29bda0ceae5E+0xec): undefined reference to `open64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/mod.rs:130:(.text._ZN3std2rt19lang_start_internal17hea39f29bda0ceae5E+0x138): undefined reference to `open64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/mod.rs:130:(.text._ZN3std2rt19lang_start_internal17hea39f29bda0ceae5E+0x15c): undefined reference to `open64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/mod.rs:(.text._ZN3std2rt19lang_start_internal17hea39f29bda0ceae5E+0x180): undefined reference to `open64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::file_attr':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN3std2fs4read5inner17h0a6abcc43e9b7143E+0x11c): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN3std2fs14read_to_string5inner17hb4042fb3225ac271E+0x11c): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::truncate::{{closure}}':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1226:(.text._ZN3std2fs4File7set_len17h9bc6f350818bde39E+0x20): undefined reference to `ftruncate64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1226:(.text._ZN3std2fs4File7set_len17h9bc6f350818bde39E+0x68): undefined reference to `ftruncate64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::file_attr':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN3std2fs4File8metadata17h4c18b3d015e9dea1E+0x54): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN3std2fs24buffer_capacity_required17h3bc0b1ecfc6bf3e7E+0x50): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::seek':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1288:(.text._ZN3std2fs24buffer_capacity_required17h3bc0b1ecfc6bf3e7E+0x6c): undefined reference to `lseek64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1288:(.text._ZN3std2fs24buffer_capacity_required17h3bc0b1ecfc6bf3e7E+0xb4): undefined reference to `lseek64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1288:(.text._ZN51_$LT$$RF$std..fs..File$u20$as$u20$std..io..Seek$GT$4seek17h18d6d29ab7659502E+0x20): undefined reference to `lseek64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1288:(.text._ZN47_$LT$std..fs..File$u20$as$u20$std..io..Seek$GT$4seek17h470a27781626d673E+0x1c): undefined reference to `lseek64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1288:(.text._ZN3std2fs81_$LT$impl$u20$std..io..Seek$u20$for$u20$alloc..sync..Arc$LT$std..fs..File$GT$$GT$4seek17h8186b8a18c7f1002E+0x20): undefined reference to `lseek64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fd::FileDesc::read_at':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fd.rs:143:(.text._ZN60_$LT$std..fs..File$u20$as$u20$std..os..unix..fs..FileExt$GT$7read_at17h65c76182240312ecE+0x18): undefined reference to `pread64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fd::FileDesc::write_at':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fd.rs:310:(.text._ZN60_$LT$std..fs..File$u20$as$u20$std..os..unix..fs..FileExt$GT$8write_at17he74a6bf35ec9a2deE+0x18): undefined reference to `pwrite64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::lstat::{{closure}}':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1709:(.text.unlikely._ZN3std3sys6common14small_c_string24run_with_cstr_allocating17h723f5819f44ac80eE+0x94): undefined reference to `lstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::stat::{{closure}}':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1690:(.text.unlikely._ZN3std3sys6common14small_c_string24run_with_cstr_allocating17hca27fc3271f75290E+0x94): undefined reference to `stat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fd::FileDesc::read_at':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fd.rs:143:(.text._ZN3std3sys4unix2fd8FileDesc7read_at17hb5f207f16f8e4772E+0x18): undefined reference to `pread64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fd::FileDesc::write_at':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fd.rs:310:(.text._ZN3std3sys4unix2fd8FileDesc8write_at17h90b9e1e9cd268532E+0x18): undefined reference to `pwrite64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `<std::sys::unix::fs::ReadDir as core::iter::traits::iterator::Iterator>::next':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:718:(.text._ZN86_$LT$std..sys..unix..fs..ReadDir$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1bc1673078372373E+0x48): undefined reference to `readdir64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:718:(.text._ZN86_$LT$std..sys..unix..fs..ReadDir$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1bc1673078372373E+0xa0): undefined reference to `readdir64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:718:(.text._ZN86_$LT$std..sys..unix..fs..ReadDir$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1bc1673078372373E+0xcc): undefined reference to `readdir64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::DirEntry::metadata':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:884:(.text._ZN3std3sys4unix2fs8DirEntry8metadata17h790c0f537b80e4feE+0x6c): undefined reference to `fstatat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::open_c::{{closure}}':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1133:(.text._ZN3std3sys4unix2fs4File6open_c17hf41a2e5a2f2bc1d2E+0x108): undefined reference to `open64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1133:(.text._ZN3std3sys4unix2fs4File6open_c17hf41a2e5a2f2bc1d2E+0x154): undefined reference to `open64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::stat::{{closure}}':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1690:(.text._ZN3std3sys4unix2fs4stat17h3bf011a82d66a26eE+0xb8): undefined reference to `stat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::lstat::{{closure}}':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1709:(.text._ZN3std3sys4unix2fs5lstat17h644c9977c49bc9d0E+0xb8): undefined reference to `lstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::file_attr':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN3std3sys4unix2fs4copy17he5705601d5a36792E+0x128): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN3std3sys4unix2fs4copy17he5705601d5a36792E+0x290): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::remove_dir_impl::openat_nofollow_dironly::{{closure}}':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:2034:(.text._ZN3std3sys4unix2fs15remove_dir_impl24remove_dir_all_recursive17hf81cd47d46dff3bcE+0x40): undefined reference to `openat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:2034:(.text._ZN3std3sys4unix2fs15remove_dir_impl24remove_dir_all_recursive17hf81cd47d46dff3bcE+0x18c): undefined reference to `openat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::file_attr':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN83_$LT$std..io..stdio..StdinLock$u20$as$u20$std..sys..unix..kernel_copy..CopyRead$GT$10properties17h21d8cb7128f63960E+0x50): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN85_$LT$std..io..stdio..StdoutLock$u20$as$u20$std..sys..unix..kernel_copy..CopyWrite$GT$10properties17h5f306a38db032d0bE+0x50): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN85_$LT$std..io..stdio..StderrLock$u20$as$u20$std..sys..unix..kernel_copy..CopyWrite$GT$10properties17hc16e2da373a70f3aE+0x50): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN3std3sys4unix11kernel_copy10fd_to_meta17hc48191cb7be77be5E+0x5c): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::kernel_copy::sendfile_splice':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/kernel_copy.rs:694:(.text._ZN3std3sys4unix11kernel_copy15sendfile_splice17h130ab8e48888a5d7E+0xb8): undefined reference to `sendfile64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::os::glibc_version':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/os.rs:762:(.text._ZN3std3sys4unix2os13glibc_version17h8365a6e1ac8e2caaE+0x14): undefined reference to `gnu_get_libc_version'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::stack_overflow::imp::get_stackp':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/stack_overflow.rs:152:(.text._ZN3std3sys4unix14stack_overflow3imp12make_handler17h92e28d89d5f34b6fE+0x58): undefined reference to `mmap64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::net::on_resolver_failure':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/net.rs:585:(.text._ZN104_$LT$std..sys_common..net..LookupHost$u20$as$u20$core..convert..TryFrom$LT$$LP$$RF$str$C$u16$RP$$GT$$GT$8try_from28_$u7b$$u7b$closure$u7d$$u7d$17h17a357d906eec6a4E+0x7c): undefined reference to `__res_init'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::File::file_attr':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1152:(.text._ZN3std12backtrace_rs9symbolize5gimli4mmap17hc366477bdd5f93a6E+0x130): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::backtrace_rs::symbolize::gimli::mmap::Mmap::map':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/symbolize/gimli/mmap_unix.rs:19:(.text._ZN3std12backtrace_rs9symbolize5gimli4mmap17hc366477bdd5f93a6E+0x1d8): undefined reference to `mmap64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(std-ff9e2f4daa5f5044.std.4db1104d53c930b1-cgu.0.rcgu.o): in function `std::sys::unix::fs::stat::{{closure}}':
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/fs.rs:1690:(.text._ZN3std12backtrace_rs9symbolize5gimli3elf17debug_path_exists17h706754ae73b4663eE+0xb8): undefined reference to `stat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o): in function `posixOpen':
sqlite3mc.c:(.text+0xc6c0): undefined reference to `open64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o): in function `writeFile':
sqlite3mc.c:(.text+0x33794): undefined reference to `fopen64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: sqlite3mc.c:(.text+0x338f4): undefined reference to `stat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o): in function `readFileContents':
sqlite3mc.c:(.text+0x8b98c): undefined reference to `fopen64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o): in function `writefileFunc':
sqlite3mc.c:(.text+0xa4a44): undefined reference to `stat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o): in function `fsdirNext':
sqlite3mc.c:(.text+0xa4b18): undefined reference to `readdir64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: sqlite3mc.c:(.text+0xa4b70): undefined reference to `lstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o): in function `fsdirFilter':
sqlite3mc.c:(.text+0xa4d9c): undefined reference to `lstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o):(.data.rel+0x68): undefined reference to `stat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o):(.data.rel+0x80): undefined reference to `fstat64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o):(.data.rel+0x98): undefined reference to `ftruncate64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o):(.data.rel+0xb0): undefined reference to `fcntl64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o):(.data.rel+0xe0): undefined reference to `pread64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o):(.data.rel+0x128): undefined reference to `pwrite64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o):(.data.rel+0x218): undefined reference to `mmap64'
/usr/lib/gcc/aarch64-alpine-linux-musl/13.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/tursodatabase/[email protected]/lib/linux_arm64/libsql_experimental.a(sqlite3mc.c.o):(.data.rel+0x290): undefined reference to `lstat64'
collect2: error: ld returned 1 exit status

Error: building at STEP "RUN CGO_ENABLED=1 go build -o main .": while running runtime: exit status 1

Steps to reproduce

On a new folder:

// go.mod

module libsql-alpine

go 1.22.4

require github.com/tursodatabase/go-libsql v0.0.0-20240429120401-651096bbee0b

require (
	github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
	github.com/libsql/sqlite-antlr4-parser v0.0.0-20240327125255-dbf53b6cbf06 // indirect
	golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
)
// main.go

package main

import "github.com/tursodatabase/go-libsql"

func main() {
    var _ libsql.Connector
}
# Dockerfile

FROM golang:1.22-alpine as builder
WORKDIR /app
COPY . .
RUN apk add --no-cache build-base
RUN CGO_ENABLED=1 go build -o main .

Then run:

$ docker build .
@prcastro prcastro changed the title Error when compiling on alpine images (musl libc) Error when compiling on alpine docker images (musl libc) Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant