coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils-8.15.74-be17e3 build failure on FreeBSD 9.0 x86


From: Jim Meyering
Subject: Re: coreutils-8.15.74-be17e3 build failure on FreeBSD 9.0 x86
Date: Sun, 18 Mar 2012 02:44:57 +0100

Nelson H. F. Beebe wrote:
> My normal builds of coreutils-8.15.74-be17e3 failed on
> FreeBSD 9.0 x86 like this:
>
>         CCLD     sort
>       sort.o: In function `sortlines':
>       sort.c:(.text+0x670e): undefined reference to `pthread_create'

Hi Nelson,
Thanks for all the testing.
I was able to make it build on that system using this:

   make CC='gcc -std=gnu99 -pthread'

Obviously, we shouldn't have do any such thing manually.
In case anyone feels like investigating this, here are more details:

  freebsd$ gcc -v
  Using built-in specs.
  Target: i386-undermydesk-freebsd
  Configured with: FreeBSD/i386 system compiler
  Thread model: posix
  gcc version 4.2.1 20070831 patched [FreeBSD]


> I then tried a fresh build:
>
>       % set path= ( /bin /usr/bin )
>       % ./configure --disable-threads && make all check
>         CCLD     sort
>       sort.o: In function `sortlines':
>       /local/build/cc/coreutils-8.15.74-be17e3/src/sort.c:3571: undefined 
> reference to `pthread_create'
>       *** Error code 1
>
> If threads are disabled, why is sort.c still trying to use them?

That could be a bug, but as far as I know, you're the first
one to report that it doesn't work.

In any case, with my work-around, "make check" had these three failures:

FAIL: dd/sparse
===============
...

FAIL: misc/help-version
=======================
...
+ env who
who: /etc/utmp: No such file or directory
+ echo FAIL: who
FAIL: who
+ fail=1

Same for pinky and one or two others.


FAIL: misc/nohup
================
+ rm -f nohup.out err exp
+ nohup sh -c 'echo stdout; echo stderr 1>&2'
stderr
./misc/nohup: 1: Syntax error: Unterminated quoted string
./misc/nohup: 53: Syntax error: Error in command substitution

This is due to a legit bug in the test script.
My first reaction to the code in question was
"How on earth did that test pass!?!"

Considering a reduced version it's easier to see:

#!/bin/sh
fail=0
if false; then
  test "junk`" = whatever || fail=1
else
  test "more-junk`" = anything || fail=1
fi
exit $fail

There is no "else" clause in this snippet.
That "else" is part of the nonsensical `...` construct.

Here's the patch:

>From f1a38037e5d9f6bad4ba486ff67c71d0655d9f48 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 18 Mar 2012 02:33:53 +0100
Subject: [PATCH] tests: fix quoting bug in misc/nohup

* tests/misc/nohup: Fix invalid quoting.
---
 tests/misc/nohup |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/misc/nohup b/tests/misc/nohup
index c6082ac..cef8ee8 100755
--- a/tests/misc/nohup
+++ b/tests/misc/nohup
@@ -50,9 +50,9 @@ rm -f nohup.out err exp
 # change depending on whether stderr is redirected.
 nohup sh -c 'echo stdout; echo stderr 1>&2' >out || fail=1
 if test -t 2; then
-  test "'cat out|tr '\n' -`" = stdout-stderr- || fail=1
+  test "$(cat out|tr '\n' -)" = stdout-stderr- || fail=1
 else
-  test "'cat out|tr '\n' -`" = stdout- || fail=1
+  test "$(cat out|tr '\n' -)" = stdout- || fail=1
 fi
 # It must *not* exist.
 test -f nohup.out && fail=1
--
1.7.10.rc1.9.g214d2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]