diff mbox series

libgo patch committed: Fix Makefile bug setting LD_LIBRARY_PATH

Message ID CAOyqgcVrpOM4-7GMmGere0UTqmxSmeHAvWMKeMb+X3H1H48Q_w@mail.gmail.com
State New
Headers show
Series libgo patch committed: Fix Makefile bug setting LD_LIBRARY_PATH | expand

Commit Message

Ian Lance Taylor Nov. 21, 2017, 6:19 a.m. UTC
This patch by Than McIntosh fixes a small bug in the libgo Makefile
recipe that constructs the directory from which to pick up
libgcc_s.so; the gccgo invocation with -print-libgcc-file-name was
missing the flags, which meant that for -m32 builds we'd see the
64-bit libgcc dir.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian

Comments

Eric Botcazou Nov. 21, 2017, 7:53 p.m. UTC | #1
> This patch by Than McIntosh fixes a small bug in the libgo Makefile
> recipe that constructs the directory from which to pick up
> libgcc_s.so; the gccgo invocation with -print-libgcc-file-name was
> missing the flags, which meant that for -m32 builds we'd see the
> 64-bit libgcc dir.  Bootstrapped and ran Go testsuite on
> x86_64-pc-linux-gnu.  Committed to mainline.

Thanks, this helps on Solaris.  I have attached another fixlet: the -q option 
of grep is rejected on Solaris.  Tested on Linux and Solaris.
Ian Lance Taylor Nov. 22, 2017, 12:27 a.m. UTC | #2
On Tue, Nov 21, 2017 at 11:53 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> This patch by Than McIntosh fixes a small bug in the libgo Makefile
>> recipe that constructs the directory from which to pick up
>> libgcc_s.so; the gccgo invocation with -print-libgcc-file-name was
>> missing the flags, which meant that for -m32 builds we'd see the
>> 64-bit libgcc dir.  Bootstrapped and ran Go testsuite on
>> x86_64-pc-linux-gnu.  Committed to mainline.
>
> Thanks, this helps on Solaris.  I have attached another fixlet: the -q option
> of grep is rejected on Solaris.  Tested on Linux and Solaris.

Thanks.  Committed.

Ian
Bernhard Reutner-Fischer Nov. 22, 2017, 8:01 a.m. UTC | #3
On 21 November 2017 20:53:50 CET, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> This patch by Than McIntosh fixes a small bug in the libgo Makefile
>> recipe that constructs the directory from which to pick up
>> libgcc_s.so; the gccgo invocation with -print-libgcc-file-name was
>> missing the flags, which meant that for -m32 builds we'd see the
>> 64-bit libgcc dir.  Bootstrapped and ran Go testsuite on
>> x86_64-pc-linux-gnu.  Committed to mainline.
>
>Thanks, this helps on Solaris.  I have attached another fixlet: the -q
>option 
>of grep is rejected on Solaris.  Tested on Linux and Solaris.

How can that be?
grep -q was even required by SUSv2 from 1997 so Solaris should really support it.
What version if Solaris is that and what version of grep?

thanks,
Eric Botcazou Nov. 22, 2017, 8:07 a.m. UTC | #4
> grep -q was even required by SUSv2 from 1997 so Solaris should really
> support it. What version if Solaris is that and what version of grep?

/usr/bin/grep on Solaris 10 (/usr/xpg4/bin/grep does support it).
Bernhard Reutner-Fischer Nov. 22, 2017, 8:25 a.m. UTC | #5
On 22 November 2017 at 09:07, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> grep -q was even required by SUSv2 from 1997 so Solaris should really
>> support it. What version if Solaris is that and what version of grep?
>
> /usr/bin/grep on Solaris 10 (/usr/xpg4/bin/grep does support it).

Why would we want to use /usr/bin ?
According to https://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html
---8<---
Utilities

If the behavior required by POSIX.2, POSIX.2a, XPG4, SUS, or SUSv2
conflicts with historical Solaris utility behavior, the original
Solaris version of the utility is unchanged; a new version that is
standard-conforming has been provided in /usr/xpg4/bin. If the
behavior required by POSIX.1–2001 or SUSv3 conflicts with historical
Solaris utility behavior, a new version that is standard-conforming
has been provided in /usr/xpg4/bin or in /usr/xpg6/bin. If the
behavior required by POSIX.1–2001 or SUSv3 conflicts with POSIX.2,
POSIX.2a, SUS, or SUSv2, a new version that is SUSv3
standard-conforming has been provided in /usr/xpg6/bin.
---8<---

So we should obviously make sure to prefer /usr/xpg6/bin over
/usr/xpg4/bin over /usr/bin.
If we don't then i would say that's the bug to fix, not warp back in
time 20 years. Why let solaris hold hostage everybody else?

thanks,
Eric Botcazou Nov. 22, 2017, 10:16 a.m. UTC | #6
> If we don't then i would say that's the bug to fix, not warp back in
> time 20 years. Why let solaris hold hostage everybody else?

Let's not start a flame war, please.  Almost all other uses of grep in the 
libgo directory have >/dev/null instead of -q and nobody chokes on them.
diff mbox series

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 254983)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-5485b3faed476f6d051833d1790b5f77be9d1efc
+fecb92bda0aa6d70c89d14635ff568df77d2bb5f
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/Makefile.am
===================================================================
--- libgo/Makefile.am	(revision 254729)
+++ libgo/Makefile.am	(working copy)
@@ -1001,7 +1001,7 @@  CHECK = \
 	export MAKE; \
 	NM="$(NM)"; \
 	export NM; \
-	libgccdir=`${GOC} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
+	libgccdir=`${GOC} ${GOCFLAGS} -print-libgcc-file-name | sed -e 's|/[^/]*$$||'`; \
 	LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:$${libgccdir}:${LD_LIBRARY_PATH}"; \
 	LD_LIBRARY_PATH=`echo $${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
 	export LD_LIBRARY_PATH; \