Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 728540 - net-misc/linuxptp fails to compile
Summary: net-misc/linuxptp fails to compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Beierlein
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-17 07:05 UTC by Agostino Sarubbo
Modified: 2020-11-05 14:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,10.67 KB, text/plain)
2020-06-17 07:05 UTC, Agostino Sarubbo
Details
linuxptp_nettstamp-systypes.patch (nettstamp-systypes.patch,1.34 KB, patch)
2020-07-02 15:02 UTC, Marek Szuba
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-06-17 07:05:45 UTC
@@This is an auto-filed bug@@
If you think that a different summary clarifies the issue better, feel free to change it.

Issue: net-misc/linuxptp fails to compile.
Discovered on: amd64

NOTE:
If you need further logs, feel free to ask.
Comment 1 Agostino Sarubbo gentoo-dev 2020-06-17 07:05:50 UTC
Created attachment 645042 [details]
build.log

build log and emerge --info
Comment 2 Thomas Beierlein gentoo-dev 2020-06-17 12:50:51 UTC
Here we are again, but thanks for the test.

Digging deeper:

- A script in the buildsystem checks for predefined values in standard header files (namely for 'clock_adjtime' in time.h or timex.h). 
- If found it sets '-DHAVE_CLOCK_ADJTIME'. 
- If not set it uses a self defined function from missing.h

Looking into the log we see:
- -DHVAE_CLOCK_ADJTIME' is NOT set
- but the function is used from /usr/include/bits/time.h

So the compiler uses the additional definition from missing.h but afterwards find the one in time.h.

Somewhere the script misses to find these already existing definition.

As I can not reproduce the failure here (on 4 different gentoo systems, stable and unstable ones) can you please check the following snippets from yours system
command line and give back its output?

1. 
 # Get list of directories searched for header files.
echo "" | ${CROSS_COMPILE}cpp -Wp,-v 2>&1 >/dev/null | grep ^" /"


2. 
# Get list of directories searched for header files
dirs=$(echo "" | ${CROSS_COMPILE}cpp -Wp,-v 2>&1 >/dev/null | grep ^" /")

# Look for clock_adjtime().
for d in $dirs; do
        files=$(find $d -type f -name time.h -o -name timex.h)
        for f in $files; do
                 if grep -q clock_adjtime $f; then
                        printf " -DHAVE_CLOCK_ADJTIME"
                        break 2
                 fi
        done
done

Thanks.
Comment 3 Marek Szuba archtester gentoo-dev 2020-07-02 15:02:55 UTC
Created attachment 647360 [details, diff]
linuxptp_nettstamp-systypes.patch

The attached patch takes care of the matter.
Comment 4 Agostino Sarubbo gentoo-dev 2020-09-24 08:24:31 UTC
Hello, thanks for the patch. I believe you can speed up the process by making a pull-request via Github.
Comment 5 Larry the Git Cow gentoo-dev 2020-11-05 14:18:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28c002049ff9906d32d61a3940b53e845fab3bb3

commit 28c002049ff9906d32d61a3940b53e845fab3bb3
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2020-11-05 14:11:42 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2020-11-05 14:18:05 +0000

    net-misc/linuxptp: fix compilation error
    
    Invoking maintainer time-out.
    
    Closes: https://bugs.gentoo.org/728540
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 .../files/linuxptp-2.0_nettstamp-systypes.patch    | 52 ++++++++++++++++++++++
 net-misc/linuxptp/linuxptp-2.0-r1.ebuild           |  4 ++
 2 files changed, 56 insertions(+)