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

[Bug]: clean build of lvm2 is not buildable: "ld: error: unable to find library -lpthread" #15210

Closed
silvio opened this issue Feb 15, 2023 · 4 comments · Fixed by #15211
Closed
Labels
bug report Something is not working properly.

Comments

@silvio
Copy link

silvio commented Feb 15, 2023

Problem description

When I try to build lvm2 I get a build error:

ld: error: unable to find library -lpthread
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../libdm/make.tmpl:436: ioctl/libdevmapper.so.1.02] Error 1
make: *** [make.tmpl:383: libdm.device-mapper] Error 2

The build which doesn't work:

$ git rev-parse HEAD
26550d3cbd733cfdc3dc670e6057bf8ee54c45e9

The whole log:

builder@d98f94ef4244:~/termux-packages$ ./build-package.sh -a aarch64 root-packages/lvm2                                                                                                                                                                                                                                                                                     
termux - building lvm2 for arch aarch64...                                                                                                                                                                                                                                                                                                                                   
Downloading https://github.com/termux/termux-elf-cleaner/releases/download/v2.1.1/termux-elf-cleaner                                                                                                                                                                                                                                                                         
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                                                                                                                                                                                                                                                                              
                                 Dload  Upload   Total   Spent    Left  Speed                                                                                                                                                                                                                                                                                                
  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0                                                                                                                                                                                                                                                                                               
100 63912  100 63912    0     0   5919      0  0:00:10  0:00:10 --:--:-- 15217                                                                                                                                                                                                                                                                                               
Building dependency libaio if necessary...                                                                                                                                                                                                                                                                                                                                   
libaio@0.3.113 built - skipping (rm /data/data/.built-packages/libaio to force rebuild)                                                                                                                                                                                                                                                                                      
Building dependency libandroid-support if necessary...                                                                                                                                                                                                                                                                                                                       
libandroid-support@28-3 built - skipping (rm /data/data/.built-packages/libandroid-support to force rebuild)                                                                                                                                                                                                                                                                 
Building dependency libcap-ng if necessary...                                                                                                                                                                                                                                                                                                                                
libcap-ng@2:0.8.3 built - skipping (rm /data/data/.built-packages/libcap-ng to force rebuild)                                                                                                                                                                                                                                                                                
Building dependency ncurses if necessary...                                                                                                                                                                                                                                                                                                                                  
ncurses@6.4-1 built - skipping (rm /data/data/.built-packages/ncurses to force rebuild)                                                                                                                                                                                                                                                                                      
Building dependency readline if necessary...                                                                                                                                                                                                                                                                                                                                 
readline@8.2.1 built - skipping (rm /data/data/.built-packages/readline to force rebuild)                                                                                                                                                                                                                                                                                    
Building dependency zlib if necessary...                                                                                                                                                                                                                                                                                                                                     
zlib@1.2.13 built - skipping (rm /data/data/.built-packages/zlib to force rebuild)                                                                                                                                                                                                                                                                                           
Building dependency util-linux if necessary...                                                                                                                                                                                                                                                                                                                               
util-linux@2.38.1-1 built - skipping (rm /data/data/.built-packages/util-linux to force rebuild)                                                                                                                                                                                                                                                                             
Downloading https://mirrors.kernel.org/sourceware/lvm2/releases/LVM2.2.03.18.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2664k  100 2664k    0     0   379k      0  0:00:07  0:00:07 --:--:--  558k
Applying ndk-patch: bits-struct_file.h.patch
Applying ndk-patch: dirent.h.patch
Applying ndk-patch: grp.h.patch
Applying ndk-patch: linux-fcntl.h.patch
Applying ndk-patch: paths.h.patch
Applying ndk-patch: pwd.h.patch
Applying ndk-patch: redefine-TCSAFLUSH.patch
Applying ndk-patch: semaphore.h.patch
Applying ndk-patch: stdio.h.patch
Applying ndk-patch: stdlib.h.patch
Applying ndk-patch: sys-cdefs.h.patch
Applying ndk-patch: syslog.patch
Applying ndk-patch: unistd.h.patch
Applying ndk-patch: utmp.h.patch
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/21/libandroid.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/21/libc.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/21/libdl.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/21/libEGL.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/21/libGLESv1_CM.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/21/libGLESv2.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/21/libGLESv3.so'                                                                                                                                                                       
[...]
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/33/libstdc++.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/33/libsync.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/33/libvulkan.so'
termux-elf-cleaner: Removing the DT_AARCH64_BTI_PLT dynamic section entry from 'usr/lib/aarch64-linux-android/33/libz.so'
Applying patch: tools-command.c.patch
Applying patch: tools-lvresize.c.patch
configure: WARNING: unrecognized options: --disable-rpath, --disable-rpath-hack, --enable-shared, --enable-static
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-unknown-linux-android
checking target system type... aarch64-unknown-linux-android
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking for aarch64-linux-android-gcc... aarch64-linux-android-clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether aarch64-linux-android-clang accepts -g... yes
checking for aarch64-linux-android-clang option to enable C11 features... none needed
checking whether the compiler supports GNU C++... yes
checking whether aarch64-linux-android-clang++ accepts -g... yes
checking for aarch64-linux-android-clang++ option to enable C++11 features... unsupported
checking for aarch64-linux-android-clang++ option to enable C++98 features... unsupported
checking how to run the C preprocessor... aarch64-linux-android-cpp
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether aarch64-linux-android-clang needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for aarch64-linux-android-ranlib... llvm-ranlib
checking for aarch64-linux-android-readelf... llvm-readelf
checking for aarch64-linux-android-ar... llvm-ar
checking for aarch64-linux-android-cflow... no
checking for cflow... no
checking for aarch64-linux-android-cscope... no
checking for cscope... no
checking for aarch64-linux-android-chmod... no
checking for chmod... /usr/bin/chmod
configure: WARNING: using cross tools not prefixed with host triplet
checking for aarch64-linux-android-wc... no
checking for wc... /usr/bin/wc
checking for aarch64-linux-android-sort... no
checking for sort... /usr/bin/sort
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for vfork.h... no
checking for sys/time.h... yes
checking for sys/param.h... yes
checking for sys/mkdev.h... no
checking for sys/sysmacros.h... yes
checking for _Bool... yes
checking for stdbool.h that conforms to C99... yes
checking for assert.h... yes
checking for ctype.h... yes
checking for dirent.h... yes
checking for errno.h... yes
checking for fcntl.h... yes
checking for float.h... yes
checking for getopt.h... yes
checking for inttypes.h... (cached) yes
checking for langinfo.h... yes
checking for libgen.h... yes
checking for limits.h... yes
checking for locale.h... yes
checking for paths.h... yes
checking for signal.h... yes
checking for stdarg.h... yes
checking for stddef.h... yes
checking for stdio.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/file.h... yes
checking for sys/ioctl.h... yes
checking for syslog.h... yes
checking for sys/mman.h... yes
checking for sys/param.h... (cached) yes
checking for sys/resource.h... yes
checking for sys/stat.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/utsname.h... yes
checking for sys/wait.h... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking for termios.h... yes
checking for sys/statvfs.h... yes
checking for sys/timerfd.h... yes
checking for sys/vfs.h... yes
checking for linux/magic.h... yes
checking for linux/fiemap.h... yes
checking for libaio.h... yes
checking for asm/byteorder.h... yes
checking for linux/fs.h... yes
checking for malloc.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for struct stat.st_rdev... yes
checking for ptrdiff_t... yes
checking for struct stat.st_blocks... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for mode_t... yes
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for ssize_t... yes
checking for uid_t in sys/types.h... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for __builtin_clz... yes
checking for __builtin_clzll... yes
checking for __builtin_ffs... yes
checking for ftruncate... yes
checking for gethostname... yes
checking for getpagesize... yes
checking for gettimeofday... yes
checking for localtime_r... yes
checking for memchr... yes
checking for memset... yes
checking for mkdir... yes
checking for mkfifo... yes
checking for munmap... yes
checking for nl_langinfo... (cached) yes
checking for pselect... yes
checking for realpath... yes
checking for rmdir... yes
checking for setenv... yes
checking for setlocale... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strcspn... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strndup... yes
checking for strrchr... yes
checking for strspn... yes
checking for strstr... yes
checking for strtol... yes
checking for strtoul... yes
checking for uname... yes
checking for ffs... yes
checking for mallinfo2... no
checking for prlimit... yes
checking for versionsort... no
checking for working alloca.h... yes
checking for alloca... yes
checking whether closedir returns void... no
checking for working chown... (cached) yes
checking for fork... yes
checking for vfork... yes
checking for alarm... yes
checking for getpagesize... (cached) yes
checking for vprintf... yes
checking for working fork... cross
configure: WARNING: result yes guessed because of cross compilation
checking for working vfork... (cached) yes
checking whether lstat correctly handles trailing slash... no
checking whether lstat accepts an empty string... yes
checking for GNU libc compatible malloc... (cached) yes
checking for working memcmp... no
checking for working mktime... no
checking for working mmap... yes
checking for GNU libc compatible realloc... (cached) yes
checking whether stat accepts an empty string... yes
checking for working strtod... no
checking for pow... no
checking for pow in -lm... yes
checking whether to enable dependency tracking... no
checking whether to build silently... yes
checking whether to use static linking... no
checking whether aarch64-linux-android-clang accepts -pie flag... yes
checking whether aarch64-linux-android-clang accepts -Wl,-z,relro,-z,now ld flags... yes
checking file owner... 
checking group owner... 
checking device node uid... 0
checking device node gid... 0
checking device node mode... 0600
checking when to create device nodes... on resume
checking default for use_devicesfile... 0
checking default name mangling... auto
checking whether to include snapshots... internal
checking whether to include mirrors... internal
checking whether to include thin provisioning... internal
checking for aarch64-linux-android-thin_check... no
checking for thin_check... no
configure: WARNING: thin_check not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking for aarch64-linux-android-thin_dump... no
checking for thin_dump... no
configure: WARNING: thin_dump not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking for aarch64-linux-android-thin_repair... no
checking for thin_repair... no
configure: WARNING: thin_repair not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking for aarch64-linux-android-thin_restore... no
checking for thin_restore... no
configure: WARNING: thin_restore not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking whether thin_check supports the needs-check flag... yes
checking whether to include cache... internal
checking for aarch64-linux-android-cache_check... no
checking for cache_check... no
configure: WARNING: cache_check not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking for aarch64-linux-android-cache_dump... no
checking for cache_dump... no
configure: WARNING: cache_dump not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking for aarch64-linux-android-cache_repair... no
checking for cache_repair... no
configure: WARNING: cache_repair not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking for aarch64-linux-android-cache_restore... no
checking for cache_restore... no
configure: WARNING: cache_restore not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking whether cache_check supports the needs-check flag... yes
checking whether to include vdo... internal
checking for aarch64-linux-android-vdoformat... no
checking for vdoformat... no
configure: WARNING: vdoformat not found in path /home/builder/.termux-build/lvm2/tmp/config-scripts:/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
checking whether to include writecache... internal
checking whether to include integrity... internal
checking whether to enable realtime support... yes
checking whether to enable OCF resource agents... no
checking for default run directory... /run
checking whether to build cluster mirror log daemon... no
checking whether to enable debugging... no
checking whether aarch64-linux-android-clang accepts -Wjump-misses-init flag... yes
checking whether aarch64-linux-android-clang accepts -Wclobbered flag... yes
checking whether aarch64-linux-android-clang accepts -Wsync-nand flag... yes
checking for C optimisation flag... 
checking whether to use symbol versioning... no
checking whether to gather gcov profiling data... no
checking whether to enable valgrind awareness of pools... no
checking pkg-config is at least version 0.9.0... yes
checking for PKGCONFIGINIT... no
pkg-config initialized
checking for VALGRIND... no
checking whether to use device-mapper... yes
checking whether to build lvmpolld... no
checking whether to build lvmlockdsanlock... no
checking whether to build lvmlockddlm... no
checking whether to build lvmlockddlmcontrol... no
checking whether to build lvmlockdidm... no
checking whether to build lvmlockd... no
checking whether to build dmfilemapd... no
checking whether to build notifydbus... no
checking for systemd/sd-journal.h... no
checking whether to log to systemd journal... no
checking for systemd/sd-id128.h... no
checking whether to support systemd appmachineid... no
checking for BLKID... yes
checking whether to enable libblkid detection of signatures when wiping... yes
checking whether to use udev-systemd protocol for jobs in background... no
checking whether to enable synchronisation with udev processing... no
checking whether to enable installation of udev rules required for synchronisation... no
checking whether to enable executable path detection in udev rules... no
checking whether udev supports built-in blkid... no
checking whether to enable O_DIRECT... yes
checking whether to compile liblvm2cmd.so... no
checking whether to include Python D-Bus support... no
checking whether to install fsadm... yes
checking whether to install lvm_import_vdo... yes
checking whether to install blkdeactivate... yes
checking whether to use dmeventd... no
checking for getline in -lc... yes
checking for canonicalize_file_name in -lc... no
checking for dlopen in -ldl... yes
checking for log10 in -lm... yes
checking for pthread_mutex_lock in -lpthread... yes
checking whether to enable selinux support... no
checking for BLKZEROOUT in sys/ioctl.h.... yes
checking whether to use BLKZEROOUT for device zeroing... yes
checking for clock_gettime... yes
checking for struct stat has st_ctim.... yes
checking for getopt.h... (cached) yes
checking for library containing tgetent... -ltinfo
checking for readline in -lreadline... yes
checking for rl_line_buffer in -lreadline... yes
checking for rl_completion_matches... yes
checking whether to enable internationalisation... no
Package systemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `systemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'systemd' found
Package systemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `systemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'systemd' found
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking whether to enable readline... yes
checking whether to enable editline... no
checking for dlfcn.h... yes
checking for aarch64-linux-android-modprobe... no
checking for modprobe... no
checking for kernel interface choice... ioctl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating make.tmpl
config.status: creating libdm/make.tmpl
config.status: creating daemons/Makefile
config.status: creating daemons/cmirrord/Makefile
config.status: creating daemons/dmeventd/Makefile
config.status: creating daemons/dmeventd/libdevmapper-event.pc
config.status: creating daemons/dmeventd/plugins/Makefile
config.status: creating daemons/dmeventd/plugins/lvm2/Makefile
config.status: creating daemons/dmeventd/plugins/raid/Makefile
config.status: creating daemons/dmeventd/plugins/mirror/Makefile
config.status: creating daemons/dmeventd/plugins/snapshot/Makefile
config.status: creating daemons/dmeventd/plugins/thin/Makefile
config.status: creating daemons/dmeventd/plugins/vdo/Makefile
config.status: creating daemons/lvmdbusd/Makefile
config.status: creating daemons/lvmdbusd/lvmdbusd
config.status: creating daemons/lvmdbusd/lvmdb.py
config.status: creating daemons/lvmdbusd/lvm_shell_proxy.py
config.status: creating daemons/lvmdbusd/path.py
config.status: creating daemons/lvmpolld/Makefile
config.status: creating daemons/lvmlockd/Makefile
config.status: creating conf/Makefile
config.status: creating conf/example.conf
config.status: creating conf/lvmlocal.conf
config.status: creating conf/command_profile_template.profile
config.status: creating conf/metadata_profile_template.profile
config.status: creating include/Makefile
config.status: creating lib/Makefile
config.status: creating include/lvm-version.h
config.status: creating libdaemon/Makefile
config.status: creating libdaemon/client/Makefile
config.status: creating libdaemon/server/Makefile
config.status: creating libdm/Makefile
config.status: creating libdm/dm-tools/Makefile
config.status: creating libdm/libdevmapper.pc
config.status: creating man/Makefile
config.status: creating po/Makefile
config.status: creating scripts/lvm2-pvscan.service
config.status: creating scripts/blkdeactivate.sh
config.status: creating scripts/blk_availability_init_red_hat
config.status: creating scripts/blk_availability_systemd_red_hat.service
config.status: creating scripts/cmirrord_init_red_hat
config.status: creating scripts/com.redhat.lvmdbus1.service
config.status: creating scripts/dm_event_systemd_red_hat.service
config.status: creating scripts/dm_event_systemd_red_hat.socket
config.status: creating scripts/lvm2_cmirrord_systemd_red_hat.service
config.status: creating scripts/lvm2_lvmdbusd_systemd_red_hat.service
config.status: creating scripts/lvm2_lvmpolld_init_red_hat
config.status: creating scripts/lvm2_lvmpolld_systemd_red_hat.service
config.status: creating scripts/lvm2_lvmpolld_systemd_red_hat.socket
config.status: creating scripts/lvmlockd.service
config.status: creating scripts/lvmlocks.service
config.status: creating scripts/lvm2_monitoring_init_red_hat
config.status: creating scripts/lvm2_monitoring_systemd_red_hat.service
config.status: creating scripts/lvm2_tmpfiles_red_hat.conf
config.status: creating scripts/lvmdump.sh
config.status: creating scripts/Makefile
config.status: creating test/Makefile
config.status: creating tools/Makefile
config.status: creating udev/Makefile
config.status: creating include/configure.h
configure: WARNING: unrecognized options: --disable-rpath, --disable-rpath-hack, --enable-shared, --enable-static
configure: WARNING: Support for thin provisioning is limited since some thin provisioning tools are missing!
configure: WARNING: Support for cache is limited since some cache tools are missing!
configure: WARNING: Unrecognized 'vdoformat' tool is REQUIRED for VDO logical volume creation!
make -C libdm device-mapper
make -C conf device-mapper
make -C include device-mapper
make -C lib device-mapper
make -C libdaemon device-mapper
make -C man device-mapper
make -C scripts device-mapper
    [CC] hash.c
    [CC] bitset.c
make[1]: Nothing to be done for 'device-mapper'.
make[1]: Nothing to be done for 'device-mapper'.
make[1]: Nothing to be done for 'device-mapper'.
    [CC] list.c
make[1]: Nothing to be done for 'device-mapper'.
    [CC] hash.c
    [CC] radix-tree.c
    [CC] bitset.c
    [MAN] dmsetup.8
make[1]: Nothing to be done for 'device-mapper'.
    [CC] libdm-iface.c
    [MAN] dmstats.8
    [MAN] blkdeactivate.8
    [MAN] dmeventd.8
    [MAN] dmfilemapd.8
    [CC] list.c
    [CC] libdm-common.c
    [CC] libdm-config.c
    [CC] libdm-common.c
    [CC] libdm-deptree.c
    [CC] libdm-config.c
    [CC] libdm-deptree.c
    [CC] libdm-file.c
    [CC] libdm-report.c
    [CC] libdm-string.c
    [CC] libdm-file.c
    [CC] libdm-targets.c
    [CC] libdm-report.c
    [CC] libdm-timestamp.c
    [CC] pool.c
    [CC] matcher.c
    [CC] parse_rx.c
    [CC] ttree.c
    [CC] status.c
    [CC] vdo_reader.c
    [CC] vdo_target.c
    [AR] base/libbase.a
llvm-ar: warning: creating base/libbase.a
device_mapper/vdo/vdo_reader.c:50:9: warning: '__packed' macro redefined [-Wmacro-redefined]
#define __packed        __attribute__((packed))
        ^
/home/builder/.termux-build/_cache/android-r25c-api-24-v1/bin/../sysroot/usr/include/sys/cdefs.h:92:9: note: previous definition is here
#define __packed __attribute__((__packed__))
        ^
    [CC] libdm-stats.c
    [CC] libdm-string.c
1 warning generated.
    [CC] libdm-targets.c
    [CC] libdm-timestamp.c
    [CC] dbg_malloc.c
    [CC] pool.c
    [CC] parse_rx.c
    [CC] matcher.c
    [CC] ttree.c
    [CC] libdm-iface.c
    [AR] device_mapper/libdevice-mapper.a
llvm-ar: warning: creating device_mapper/libdevice-mapper.a
    [CC] ioctl/libdevmapper.so.1.02
ld: error: unable to find library -lpthread
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../libdm/make.tmpl:436: ioctl/libdevmapper.so.1.02] Error 1
make: *** [make.tmpl:383: libdm.device-mapper] Error 2

What steps will reproduce the bug?

  1. start docker container: ./scripts/run-docker.sh
  2. build package without -I via ./build-package.sh -a aarch64 root-packages/lvm2

What is the expected behavior?

No build problem, package in output folder.

System information

The docker image is the latest one:

$ docker ps | grep termux-package-builder
d98f94ef4244   ghcr.io/termux/package-builder   "/bin/bash"              5 hours ago    Up 5 hours                                                 termux-package-builder

$ docker inspect -f '{{json .Image}}' d98f94ef4244
"sha256:c4e416fbbe9ed3d8b64fa80f77ae32723c81e6a5ebcb1c58dcbe46cd81f3a3ab"

$ docker image ls | grep -i package-builder
ghcr.io/termux/package-builder                                  latest                                           c4e416fbbe9e   3 days ago      7.72GB

$ docker pull ghcr.io/termux/package-builder:latest
latest: Pulling from termux/package-builder
Digest: sha256:2921e9ed8a96010bc80b902df1de06c2965913e0e0f313709a4ef93948da8914
Status: Image is up to date for ghcr.io/termux/package-builder:latest
ghcr.io/termux/package-builder:latest
@silvio silvio added bug report Something is not working properly. untriaged labels Feb 15, 2023
@xtkoba
Copy link
Contributor

xtkoba commented Feb 15, 2023

Probably due to LDFLAGS not being respected.

@xtkoba
Copy link
Contributor

xtkoba commented Feb 15, 2023

More precisely, the configure script finds -lpthread because it respects LDFLAGS. But some of Makefiles do not.

This can potentially happen to every package.

@silvio
Copy link
Author

silvio commented Feb 15, 2023

@xtkoba I am willing to work on the topic, but I don't know how the patch management of termux-build works or how best to do it. I assume that the package is unpacked somewhere, where I would then make changes with git or quilt and enter these as patches in build.sh. How exactly do you do that?

@xtkoba
Copy link
Contributor

xtkoba commented Feb 15, 2023

Ah, maybe there is some dev guide, but personally I learned by example.

@xtkoba xtkoba linked a pull request Feb 15, 2023 that will close this issue
@xtkoba xtkoba removed the untriaged label Feb 15, 2023
xtkoba added a commit that referenced this issue Feb 15, 2023
revbumping just in case.

Fixes #15210
termux-pacman-bot added a commit to termux-pacman/termux-packages that referenced this issue Feb 15, 2023
revbumping just in case.

Fixes termux/termux-packages#15210
itsaky pushed a commit to itsaky/termux-packages that referenced this issue Feb 18, 2023
revbumping just in case.

Fixes termux#15210
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants