libtool-patches
[Top][All Lists]
Advanced

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

[PATCH] ltmain.in: don't suppress output for PIC compilations


From: Sam James
Subject: [PATCH] ltmain.in: don't suppress output for PIC compilations
Date: Wed, 14 Aug 2024 19:33:48 +0100

I just hit this in a fascinating place.

When working on xz, I set `-Werror=suggest-attribute=returns_nonnull`, and
the build failed (as I expected it to), but with no visible error from
the compiler.

There's a mysterious '>/dev/null 2>&1' on the second line where
liblzma_la-common.o is built without PIC.

With -fPIC, IPA doesn't end up doing attribute discovery. Without it,
it does. This behaviour is insane and we should patch it out.

Bug: https://bugs.gentoo.org/135865
Cc: glaubitz@physik.fu-berlin.de
Signed-off-by: Sam James <sam@gentoo.org>
---
Please consider this kind of a PoC for discussion. This came up on the
GCC bug tracker the other day which prompted me to post it and get people's
opinions. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212#c158.

libtool assumes that the warning output with vs without -fPIC is going
to be identical, hence the non-PIC build output should be completely suppressed.

I think this is a premature optimization at best, and it's caused real
confusion to people. Can we drop it?

If this looks OK, I can check more closely if I need to remove more
bits.

 build-aux/ltmain.in | 2 --
 1 file changed, 2 deletions(-)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 63377541..48e89042 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -1665,8 +1665,6 @@ compiler."
        func_append command " -o $obj"
       fi
 
-      # Suppress compiler output if we already did a PIC compilation.
-      func_append command "$suppress_output"
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 

base-commit: 22a7e547e9857fc94fe5bc7c921d9a4b49c09f8e
-- 
2.45.2




reply via email to

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