Discussion:
[Linuxptp-devel] [PATCH v2] missing: the previous patch was incorrect
Jacob Keller
2013-09-04 17:57:02 UTC
Permalink
After finding the mistake in a previous patch, I did a bit more digging and
realized this patch was broken too. This fixes the typo missing semicolon and
also fixes the grep location

Signed-off-by: Jacob Keller <***@intel.com>
---
makefile | 2 +-
missing.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/makefile b/makefile
index d79a1df..6172c3e 100644
--- a/makefile
+++ b/makefile
@@ -21,7 +21,7 @@ FEAT_CFLAGS :=
ifneq ($(shell grep --no-messages clock_adjtime /usr/include/bits/time.h),)
FEAT_CFLAGS += -D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME
endif
-ifneq ($(shell grep --no-messages HWTSTAMP_TX_ONESTEP_SYNC $(KBUILD_OUTPUT)/usr/include/linux/net_tstamp.h),)
+ifneq ($(shell grep --no-messages HWTSTAMP_TX_ONESTEP_SYNC $(KBUILD_OUTPUT)include/uapi/linux/net_tstamp.h),)
FEAT_CFLAGS += -DHAVE_ONESTEP_SYNC
endif

diff --git a/missing.h b/missing.h
index 99a8d83..d6b2355 100644
--- a/missing.h
+++ b/missing.h
@@ -47,7 +47,7 @@
#ifndef HAVE_ONESTEP_SYNC
enum _missing_hwtstamp_tx_types {
HWTSTAMP_TX_ONESTEP_SYNC = 2,
-}
+};
#endif

#ifndef HAVE_CLOCK_ADJTIME
Jiri Benc
2013-09-04 19:06:35 UTC
Permalink
Post by Jacob Keller
-ifneq ($(shell grep --no-messages HWTSTAMP_TX_ONESTEP_SYNC $(KBUILD_OUTPUT)/usr/include/linux/net_tstamp.h),)
+ifneq ($(shell grep --no-messages HWTSTAMP_TX_ONESTEP_SYNC $(KBUILD_OUTPUT)include/uapi/linux/net_tstamp.h),)
Won't work on distribution kernels that don't have include/uapi, yet
support PTP.

As I wrote in a different thread, the whole KBUILD_OUTPUT thing is
incorrect and cannot be made to work reliably.

Jiri
--
Jiri Benc
Keller, Jacob E
2013-09-04 20:17:26 UTC
Permalink
Post by Jiri Benc
Post by Jacob Keller
-ifneq ($(shell grep --no-messages HWTSTAMP_TX_ONESTEP_SYNC $(KBUILD_OUTPUT)/usr/include/linux/net_tstamp.h),)
+ifneq ($(shell grep --no-messages HWTSTAMP_TX_ONESTEP_SYNC $(KBUILD_OUTPUT)include/uapi/linux/net_tstamp.h),)
Won't work on distribution kernels that don't have include/uapi, yet
support PTP.
As I wrote in a different thread, the whole KBUILD_OUTPUT thing is
incorrect and cannot be made to work reliably.
Jiri
If you have time, could you go ahead and make a
Richard Cochran
2013-09-05 07:29:23 UTC
Permalink
Post by Jiri Benc
As I wrote in a different thread, the whole KBUILD_OUTPUT thing is
incorrect and cannot be made to work reliably.
Actually, it is correct for people who compile their own kernels.
This includes everyone who does cross development. When I started,
that was the *only* way to run a kernel that uses the PHC devices.

Now that the distros are catching up, I understand the desire to
support them, but that doesn't make what we have been doing
"incorrect".

Thanks,
Richard
Jiri Benc
2013-09-05 08:32:24 UTC
Permalink
Post by Richard Cochran
Actually, it is correct for people who compile their own kernels.
This includes everyone who does cross development. When I started,
that was the *only* way to run a kernel that uses the PHC devices.
I'd expect that for cross development you'd have the correct
version/arch of kernel-headers (or similar) package installed. But
I see your point.

As the makefile is currently constructed, there's no way to tell
whether a certain symbol is available just by using grep. You'd have to
resort to the autoconf-like constructs, or make KBUILD_OUTPUT empty by
default (plus some magic for grepping in /usr/include/linux for empty
KBUILD_OUTPUT). The latter would be fragile but would work.
Post by Richard Cochran
Now that the distros are catching up, I understand the desire to
support them, but that doesn't make what we have been doing
"incorrect".
You're right that it was not incorrect before, sorry if I chose too
harsh words. But that changed by starting to do magic in missing.h,
unfortunately.

Jiri
--
Jiri Benc
Loading...