Discussion:
[Linuxptp-users] Patch for incdefs.sh
Chris LaRocque
2015-12-24 12:46:45 UTC
Permalink
Hello

While working with buildroot, cross-compiling linuxptp for ARM I ran into;

In file included from clock.c:33:0:
missing.h:66:19: error: static declaration of ‘clock_adjtime’ follows
non-static declaration
static inline int clock_adjtime(clockid_t id, struct timex *tx)
^
In file included from missing.h:28:0,
from clock.c:33:
~/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/include/sys/timex.h:128:12:
note: previous declaration of ‘clock_adjtime’ was here
extern int clock_adjtime (clockid_t __clock_id, struct timex *__ntx)
__THROW;
^
make: *** [clock.o] Error 1

;even though uclibc 1.0.9 incorporates the feature. It is defined in
timex.h which is not found using the stock file.

-----------------------------------------------------------------------------------
--- a./incdefs.sh 2015-12-18 13:33:24.853244045 -0500
+++ b./incdefs.sh 2015-12-18 13:34:52.570367632 -0500
@@ -27,7 +27,7 @@
# Get list of directories searched for header files.
dirs=$(echo "" | ${CROSS_COMPILE}cpp -Wp,-v 2>&1 >/dev/null # Look for
clock_adjtime().
for d in $dirs; do
- files=$(find $d -type f -name time.h)
+ files=$(find $d -regextype posix-egrep -regex ".*/time.*.h")
for f in $files; do
if grep -q clock_adjtime $f; then
printf " -DHAVE_CLOCK_ADJTIME"

-----------------------------------------------------------------------------------------

Regards

Chris LaRocque
Richard Cochran
2016-01-03 21:47:23 UTC
Permalink
Post by Chris LaRocque
While working with buildroot, cross-compiling linuxptp for ARM I ran into;
Thanks for posting this fix.
Post by Chris LaRocque
- files=$(find $d -type f -name time.h)
+ files=$(find $d -regextype posix-egrep -regex ".*/time.*.h")
I would prefer this instead:

files=$(find $d -type f -name time.h -o -name timex.h)

Can you see if that works for your uClinux setup as well?

Thanks,
Richard


------------------------------------------------------------------------------
Loading...