foss-for-synopsys-dwc-arc-processors / buildroot

The development tree for Buildroot support for the Synopsys DesignWare ARC processor family
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/blob/arc-dev/README.md
Other
7 stars 2 forks source link

Building "ntp" fails against glibc 2.34 #19

Closed shahab-vahedi closed 2 years ago

shahab-vahedi commented 2 years ago

While building ntp-4.2.8p15 with buildroot, the build fails with:

In file included from /lib/gcc/arc64-linux-gnu/11.1.1/include-fixed/pthread.h:42,
                 from work_thread.c:13
work_thread.c:45:57: error: missing binary operator before token "("
   45 | #if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN
      |                                                         ^~~~~~~~~~~~~~~~~

This happens, because PTHREAD_STACK_MIN is a dynamic value now :

#define PTHREAD_STACK_MIN ((size_t)_sysconf(_SC_THREAD_STACK_MIN))

Buildroot setup

Fetch URL: git@github.com:foss-for-synopsys-dwc-arc-processors/buildroot.git
906369aa75 (origin/arc64) package/libressl: bump version to 3.3.3

BR2_arcle=y
BR2_arc64=y
BR2_ENABLE_DEBUG=y
BR2_DEBUG_3=y
BR2_OPTIMIZE_0=y
BR2_SHARED_STATIC_LIBS=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_PATH="/path/to/arcv3-lnx"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-linux-gnu"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_6=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="arc64"
BR2_TARGET_GENERIC_ISSUE="Welcome to Valhalla"
BR2_ROOTFS_DEVICE_TABLE="/path/to/device_table.txt"
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_OVERLAY="/path/to/overlay"
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_TREE=y
BR2_PACKAGE_NFS_UTILS=y
BR2_PACKAGE_SSHFS=y
BR2_PACKAGE_LIBRESSL=y
BR2_PACKAGE_ELFUTILS=y
BR2_PACKAGE_NCURSES_WCHAR=y
BR2_PACKAGE_NCURSES_TARGET_PROGS=y
BR2_PACKAGE_NCURSES_ADDITIONAL_TERMINFO="t/tmux"
BR2_PACKAGE_READLINE=y
BR2_PACKAGE_NTP=y
BR2_PACKAGE_NTP_NTPDATE=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_PACKAGE_HOST_KMOD=y

glibc setup

Fetch URL: https://github.com/foss-for-synopsys-dwc-arc-processors/glibc
2dcdae68d5 (origin/arc64-2.34, origin/arc64) ARC64: enable in build-many-glibcs
abrodkin commented 2 years ago

That's a problem of ntp package when glibc 2.34+ is used as there PTHREAD_STACK_MIN is no longer a compile-time constant, see https://github.com/openembedded/meta-openembedded/commit/7055c764c83150f9310ce04bcfb19330460582fc

Similar patch applied to our local Buildroot tree (https://github.com/foss-for-synopsys-dwc-arc-processors/buildroot/compare/arc64-2021.08.x) by @temap via https://github.com/foss-for-synopsys-dwc-arc-processors/buildroot/commit/666196c84487d5b7ee127d906757af9fcd785218.

abrodkin commented 2 years ago

Fix posted to Buildroot: https://lists.buildroot.org/pipermail/buildroot/2021-September/623040.html