Source-Changes-HG archive

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

[src/trunk]: src ld wants to create a 0-byte file before it starts linking, with



details:   https://anonhg.NetBSD.org/src/rev/91b81d0be7cd
branches:  trunk
changeset: 759003:91b81d0be7cd
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Nov 23 18:30:26 2010 +0000

description:
ld wants to create a 0-byte file before it starts linking, with
the default being ./a.out.  If we run build.sh rumptest from a r/o
fs, linking fails before it gets to the parts that interest us and
the whole test silently fails.

So:
1) use -o /tmp/rumptest.$$ (objdir might be better, but I couldn't
   determine with a high confidence how to obtain the definite one
   in build.sh)
2) catch "cannot open output file" error from ld

diffstat:

 build.sh |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 22c69e54bbbb -r 91b81d0be7cd build.sh
--- a/build.sh  Tue Nov 23 18:05:17 2010 +0000
+++ b/build.sh  Tue Nov 23 18:30:26 2010 +0000
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#      $NetBSD: build.sh,v 1.240 2010/08/24 20:52:31 pgoyette Exp $
+#      $NetBSD: build.sh,v 1.241 2010/11/23 18:30:26 pooka Exp $
 #
 # Copyright (c) 2001-2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1384,7 +1384,7 @@
        eval cat <<EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.240 2010/08/24 20:52:31 pgoyette Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.241 2010/11/23 18:30:26 pooka Exp $
 # with these arguments: ${_args}
 #
 
@@ -1629,7 +1629,7 @@
        for set in ${RUMP_LIBSETS} ; do
                IFS="${oIFS}"
                ${runcmd} ${tool_ld} -nostdlib -L${DESTDIR}/usr/lib     \
-                   -static --whole-archive ${set} 2>&1 |               \
+                   -static --whole-archive ${set} 2>&1 -o /tmp/rumptest.$$ | \
                      awk -v quirks="${md_quirks}" '
                        /undefined reference/ &&
                            !/more undefined references.*follow/{
@@ -1638,6 +1638,7 @@
                                        fails[NR] = $0
                        }
                        /cannot find -l/{fails[NR] = $0}
+                       /cannot open output file/{fails[NR] = $0}
                        END{
                                for (x in fails)
                                        print fails[x]



Home | Main Index | Thread Index | Old Index