diff options
author | Marek Szuba <marecki@gentoo.org> | 2022-08-15 14:30:20 +0100 |
---|---|---|
committer | Marek Szuba <marecki@gentoo.org> | 2022-08-15 14:37:04 +0100 |
commit | 6274f4bc036e953c693b17e21a2946520a90b48f (patch) | |
tree | e6c6d4cdd38bb4866a07c21050baf2a2ab941b62 /net-misc/linuxptp | |
parent | app-admin/mcelog: add 188 (diff) | |
download | gentoo-6274f4bc036e953c693b17e21a2946520a90b48f.tar.gz gentoo-6274f4bc036e953c693b17e21a2946520a90b48f.tar.bz2 gentoo-6274f4bc036e953c693b17e21a2946520a90b48f.zip |
net-misc/linuxptp: honour user value of CPP
Upstream build scripts call the preprocessor to acquire the list
of system include directories, which is then used to locate the
declaration of clock_adjtime(). However, they hard-coded the
preprocessor name to "cpp" - and if that is absent (e.g. on a system
without native gcc symlinks) the script invoking it gets an empty list
of directories, assumes the absence of clock_adjtime() definition and
compensates by enabling a custom one, and subsequently causes a build
failure when the two definitions collide.
Closes: https://bugs.gentoo.org/864557
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'net-misc/linuxptp')
-rw-r--r-- | net-misc/linuxptp/files/linuxptp-3.1.1-user_cpp.patch | 11 | ||||
-rw-r--r-- | net-misc/linuxptp/linuxptp-3.1.1.ebuild | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/net-misc/linuxptp/files/linuxptp-3.1.1-user_cpp.patch b/net-misc/linuxptp/files/linuxptp-3.1.1-user_cpp.patch new file mode 100644 index 000000000000..d2b3728b6141 --- /dev/null +++ b/net-misc/linuxptp/files/linuxptp-3.1.1-user_cpp.patch @@ -0,0 +1,11 @@ +--- a/incdefs.sh ++++ b/incdefs.sh +@@ -27,7 +27,7 @@ + printf " -D_GNU_SOURCE" + + # Get list of directories searched for header files. +- dirs=$(echo "" | ${CROSS_COMPILE}cpp -Wp,-v 2>&1 >/dev/null | grep ^" /") ++ dirs=$(echo "" | ${CPP} -Wp,-v - 2>&1 >/dev/null | grep ^" /") + + # Look for clock_adjtime(). + for d in $dirs; do diff --git a/net-misc/linuxptp/linuxptp-3.1.1.ebuild b/net-misc/linuxptp/linuxptp-3.1.1.ebuild index faae13c19360..281c2325d00b 100644 --- a/net-misc/linuxptp/linuxptp-3.1.1.ebuild +++ b/net-misc/linuxptp/linuxptp-3.1.1.ebuild @@ -17,13 +17,17 @@ DEPEND="elibc_musl? ( sys-libs/queue-standalone )" CONFIG_CHECK="~NETWORK_PHY_TIMESTAMPING ~PPS ~PTP_1588_CLOCK" +PATCHES=( + "${FILESDIR}"/${PN}-3.1.1-user_cpp.patch +) + pkg_setup() { linux-info_pkg_setup } src_compile() { # parse needed additional CFLAGS - export MY_FLAGS=$(./incdefs.sh) + export MY_FLAGS=$(CPP="$(tc-getCPP)" ./incdefs.sh) export EXTRA_CFLAGS="${CFLAGS} ${MY_FLAGS}" emake CC="$(tc-getCC)" prefix=/usr mandir=/usr/share/man } |