Skip to contentSkip to conversation

ntp: drop uselss patch fixup which sometimes breaks rebuild

PATCH New Danomi Manchego 3 participants 5 messages Jul 5, 2015 – Jul 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntp: drop uselss patch fixup which sometimes breaks rebuild

Drop sed line which no longer changes anything. Worse, it bumps each ntpd/*.c file's modification time, which sometimes triggers a strange dependency path causing the makefile to attempt to run the ntpd keyword-gen app, which fails, because it's been cross-compiled.

---

The deleted sed line is the reason why the keyword-gen source dependency was being unexpectedly triggered, which prompted my initial patch back in July 2014, which Thomas P. did not really like as the real reason for why the initial ntp rebuild works, but the second fails, was not understood. (See http://patchwork.ozlabs.org/patch/371305/).

While its true that this patch still does not explore why things sometimes work differently in subsequent ntp rebuilds, the whole issue can be avoided by not touching the source unnecessarily.

Interestingly, someone on one of the ntp mailing lists also encountered this same issue. (See http://lists.ntp.org/pipermail/questions/2009-October/024669.html)
It doesn't appear that anything came of it. In fact, the fellow
who answered said that if you don't change the source file, then
the derived file delivered with the tarball should be up to date.

So lets not touch the source unless we have to, especially if we're not even changing anything.

---
 package/ntp/ntp.mk | 1 -
 1 file changed, 1 deletion(-)
package/ntp/ntp.mk +0 -1
index 5f05508..93cefa1 100644
@@ -42,7 +42,6 @@ endif
 
 define NTP_PATCH_FIXUPS
 	$(SED) "s,^#if.*__GLIBC__.*_BSD_SOURCE.*$$,#if 0," $(@D)/ntpd/refclock_pcf.c
-	$(SED) '/[[:space:](]rindex[[:space:]]*(/s/[[:space:]]*rindex[[:space:]]*(/ strrchr(/g' $(@D)/ntpd/*.c
 endef
 
 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_KEYGEN) += util/ntp-keygen
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ntp: drop uselss patch fixup which sometimes breaks rebuild

Danomi, All,

On 2015-07-05 16:52 -0400, Danomi Manchego spake thusly:

Quoted 36 lines

Drop sed line which no longer changes anything. Worse, it bumps each ntpd/*.c file's modification time, which sometimes triggers a strange dependency path causing the makefile to attempt to run the ntpd keyword-gen app, which fails, because it's been cross-compiled.

---

The deleted sed line is the reason why the keyword-gen source dependency was being unexpectedly triggered, which prompted my initial patch back in July 2014, which Thomas P. did not really like as the real reason for why the initial ntp rebuild works, but the second fails, was not understood. (See http://patchwork.ozlabs.org/patch/371305/).

While its true that this patch still does not explore why things sometimes work differently in subsequent ntp rebuilds, the whole issue can be avoided by not touching the source unnecessarily.

Interestingly, someone on one of the ntp mailing lists also encountered this same issue. (See http://lists.ntp.org/pipermail/questions/2009-October/024669.html)
It doesn't appear that anything came of it. In fact, the fellow
who answered said that if you don't change the source file, then
the derived file delivered with the tarball should be up to date.

So lets not touch the source unless we have to, especially if we're not even changing anything.

---
 package/ntp/ntp.mk | 1 -
 1 file changed, 1 deletion(-)
package/ntp/ntp.mk +0 -0
index 5f05508..93cefa1 100644

package/ntp/ntp.mk endif · line 44

Quoted 3 lines
package/ntp/ntp.mk +0 -0
@@ -42,7 +42,6 @@ endif
 
 define NTP_PATCH_FIXUPS
 	$(SED) "s,^#if.*__GLIBC__.*_BSD_SOURCE.*$$,#if 0," $(@D)/ntpd/refclock_pcf.c

As far as I could see, that one line does not do anything either.

package/ntp/ntp.mk endif · line 45

Quoted 2 lines
package/ntp/ntp.mk +0 -1
-	$(SED) '/[[:space:](]rindex[[:space:]]*(/s/[[:space:]]*rindex[[:space:]]*(/ strrchr(/g' $(@D)/ntpd/*.c
 endef

Indeed, this line does not change anything in the source files...

Regards,
Yann E. MORIN.

Quoted 8 lines
package/ntp/ntp.mk +0 -0
 NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_KEYGEN) += util/ntp-keygen
Signature · 6 lines
1.9.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 ntp: drop uselss patch fixup which sometimes breaks rebuild

Yann,

Quoted 10 lines

package/ntp/ntp.mk endif · line 44

Quoted 8 lines
package/ntp/ntp.mk +0 -0
index 5f05508..93cefa1 100644
@@ -42,7 +42,6 @@ endif
 
 define NTP_PATCH_FIXUPS
      $(SED) "s,^#if.*__GLIBC__.*_BSD_SOURCE.*$$,#if 0," $(@D)/ntpd/refclock_pcf.c

As far as I could see, that one line does not do anything either.

It *does* change the file - though, I don't know if the change is actually necessary. Verified by doing:

$ rm -rf output/build/ntp-4.2.8p3/
$ make -s ntp-extract
$ cp -ra output/build/ntp-4.2.8p3/ .
$ make -s ntp-patch
$ diff ntp-4.2.8p3/ntpd/refclock_pcf.c
output/build/ntp-4.2.8p3/ntpd/refclock_pcf.c
170c170
< #if defined(__GLIBC__) && defined(_BSD_SOURCE)
---
Quoted 1 line

#if 0

I imagine that this change is better done via patch than sed, if it's needed at all, but since it is actually doing something, changing it would be a different topic from removing the second line.

Danomi -

#3 lore raw

PATCH 1/1 ntp: drop uselss patch fixup which sometimes breaks rebuild

In reply to Yann E. MORIN
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Hi,

Quoted 9 lines
Quoted 9 lines

package/ntp/ntp.mk | 1 -

1 file changed, 1 deletion(-)
package/ntp/ntp.mk +0 -0
index 5f05508..93cefa1 100644
@@ -42,7 +42,6 @@ endif
 
Quoted 4 lines
Quoted 2 lines

define NTP_PATCH_FIXUPS
$(SED) "s,^#if.*__GLIBC__.*_BSD_SOURCE.*$$,#if 0," $(@D)/ntpd/refclock_pcf.c

As far as I could see, that one line does not do anything either.

Well, it protects the code in ntpd/refclock_pcf.c (which is for an obscure reference clock kit for the parallel port) which uses the tm_gmtoff member of struct tm - And that one is only available on uClibc if it is built with __UCLIBC_HAS_TM_EXTENSIONS__, so I guess it's a very old build fix for uClibc.

Looking at the git history confirms that, as it comes from:

commit 7129da009cc72575a84a30c4587bd99f745c49d4

Author: Eric Andersen <[email protected]>
Date:   Sat Jan 18 21:27:22 2003 +0000

Merge a bunch of stuff over from the tuxscreen buildroot, with many updates to make things be more consistant.
-Erik

With that said, our uClibc configs DO enable __UCLIBC_HAS_TM_EXTENSIONS__, so we can indeed drop it. I'll do so now.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 ntp: drop uselss patch fixup which sometimes breaks rebuild

In reply to Danomi Manchego
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Danomi" == Danomi Manchego <[email protected]> writes:

Drop sed line which no longer changes anything. Worse, it bumps each ntpd/*.c file's modification time, which sometimes triggers a strange dependency path causing the makefile to attempt to run the ntpd keyword-gen app, which fails, because it's been cross-compiled.

Makes sense, and the affected code has indeed been changed upstream so it doesn't do anything sensible any more. From CommitLog:

ntpd/cmd_args.c at 1.56.1.3 +2 -3
remove unused leftover global specific_interface. rindex() -> strrchr()

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard