libfaketime icon indicating copy to clipboard operation
libfaketime copied to clipboard

Build fails on llvm/musl distros:

Open lrvick opened this issue 5 months ago • 0 comments

Clang build on llvm/musl toolchain system fails with:

0.217 ld: error: version script assignment of 'GLIBC_2.3.3' to symbol 'timer_settime' failed: symbol not defined
0.217 ld: error: version script assignment of 'GLIBC_2.2.5' to symbol 'pthread_cond_timedwait' failed: symbol not defined
0.217 ld: error: version script assignment of 'GLIBC_2.3.2' to symbol 'pthread_cond_timedwait' failed: symbol not defined
0.217 ld: error: version script assignment of 'GLIBC_2.3.2' to symbol 'pthread_cond_init' failed: symbol not defined
0.217 ld: error: version script assignment of 'GLIBC_2.3.2' to symbol 'pthread_cond_destroy' failed: symbol not defined

Building using following pattern and 9.1.11 as the source:

FROM scratch AS build                                                                                                                                 
ARG VERSION                                                                                                                                           
COPY --from=stagex/core-busybox . /                                                                                                                   
COPY --from=stagex/core-llvm . /                                                                                                                      
COPY --from=stagex/core-libzstd . /                                                                                                                   
COPY --from=stagex/core-make . /                                                                                                                      
COPY --from=stagex/core-musl . /                                                                                                                      
ADD fetch/libfaketime-${VERSION}.tar.gz .                                                                                                             
WORKDIR /libfaketime-${VERSION}                                                                                                                       
ENV CFLAGS="-DFAKE_RANDOM -DFAKE_PID -DFAKE_SETTIME -DFAKE_UTIME -DINTERCEPT_SYSCALL"                                                                 
ENV CC=clang                                                                                                                                          
RUN --network=none <<-EOF                                                                                                                             
  set -eux                                                                                                                                            
  make -j "$(nproc)" PREFIX=/usr                                                                                                                      
  make DESTDIR=/rootfs install                                                                                                                        
EOF                                                                                                                                                   
FROM stagex/core-filesystem AS package                                                                                                                
COPY --from=build /rootfs/ /                                                                                                                                    

lrvick avatar Jul 24 '25 02:07 lrvick