Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 135865 - dev-build/libtool hides useful output by default
Summary: dev-build/libtool hides useful output by default
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
: 250613 (view as bug list)
Depends on:
Reported: 2006-06-07 00:13 UTC by Jeroen Roovers (RETIRED)
Modified: 2024-04-15 06:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2006-06-07 00:13:52 UTC
libtool has a command line option to not suppress printing output of the second pass of the compiler on the same object, which basically means it normally hides output which it shouldn't be doing at all.

Specifically, libtool uses this:

      # Allow error messages only from the first compilation.
      if test "$suppress_opt" = yes; then
        suppress_output=' >/dev/null 2>&1'

in to hide stuff, which is very annoying to say the least and hinders bug hunting efforts because it produces bug reports like this:

mygcc --FFfobOMG111 2>&1 >/dev/null
[Error 1]

as exemplified in the URL attached to this bug report. That build log has at least one failed build and one that succeeded, which is perhaps something worth debugging in an entirely different, but the libtool problem remains the same. THIS BUG IS ABOUT LIBTOOL THROWING AWAY USEFUL DEBUGGING INFORMATION. I've seen several cases where either of the non-PIC and PIC compile runs fails, the core of the matter being that in debugging that, libtool shouldn't throw out useful information (ever, at all).
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2006-06-07 00:18:48 UTC
"in an entirely different" <-- bug. Sorry for the bug spam. 8)
Comment 2 SpanKY gentoo-dev 2006-09-17 00:45:35 UTC
this is by design and Gentoo isnt about to change it (even though i agree with you; hiding stderr output by default is stupid)

feel free to contact the libtool guys to see if they'll change
Comment 3 SpanKY gentoo-dev 2008-12-22 06:01:57 UTC
*** Bug 250613 has been marked as a duplicate of this bug. ***
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-15 00:47:21 UTC
I just hit this in a fascinating place.

When working on xz, I set `-Werror=suggest-attribute=returns_nonnull`.

 $ make
make  all-recursive
make[1]: Entering directory '/home/sam/git/xz'
Making all in src
make[2]: Entering directory '/home/sam/git/xz/src'
Making all in liblzma
make[3]: Entering directory '/home/sam/git/xz/src/liblzma'
Making all in api
make[4]: Entering directory '/home/sam/git/xz/src/liblzma/api'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/sam/git/xz/src/liblzma/api'
make[4]: Entering directory '/home/sam/git/xz/src/liblzma'
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../..  -I../../src/liblzma/api -I../../src/liblzma/common -I../../src/liblzma/check -I../../src/liblzma/lz -I../../src/liblzma/rangecoder -I../../src/liblzma/lzma -I../../src/liblzma/delta -I../../src/liblzma/simple -I../../src/common -DTUKLIB_SYMBOL_PREFIX=lzma_  -pthread -fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs -Wshift-overflow=2 -Wstrict-overflow=3 -Walloc-zero -Wduplicated-cond -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wdate-time -Wsign-conversion -Wfloat-conversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wmissing-variable-declarations -Werror -O3 -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wsuggest-attribute=cold -Wsuggest-attribute=malloc -Wsuggest-attribute=returns_nonnull -MT liblzma_la-common.lo -MD -MP -MF .deps/liblzma_la-common.Tpo -c -o liblzma_la-common.lo `test -f 'common/common.c' || echo './'`common/common.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/liblzma/api -I../../src/liblzma/common -I../../src/liblzma/check -I../../src/liblzma/lz -I../../src/liblzma/rangecoder -I../../src/liblzma/lzma -I../../src/liblzma/delta -I../../src/liblzma/simple -I../../src/common -DTUKLIB_SYMBOL_PREFIX=lzma_ -pthread -fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs -Wshift-overflow=2 -Wstrict-overflow=3 -Walloc-zero -Wduplicated-cond -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wdate-time -Wsign-conversion -Wfloat-conversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wmissing-variable-declarations -Werror -O3 -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wsuggest-attribute=cold -Wsuggest-attribute=malloc -Wsuggest-attribute=returns_nonnull -MT liblzma_la-common.lo -MD -MP -MF .deps/liblzma_la-common.Tpo -c common/common.c  -fPIC -DPIC -o .libs/liblzma_la-common.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/liblzma/api -I../../src/liblzma/common -I../../src/liblzma/check -I../../src/liblzma/lz -I../../src/liblzma/rangecoder -I../../src/liblzma/lzma -I../../src/liblzma/delta -I../../src/liblzma/simple -I../../src/common -DTUKLIB_SYMBOL_PREFIX=lzma_ -pthread -fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs -Wshift-overflow=2 -Wstrict-overflow=3 -Walloc-zero -Wduplicated-cond -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wdate-time -Wsign-conversion -Wfloat-conversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wmissing-variable-declarations -Werror -O3 -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wsuggest-attribute=cold -Wsuggest-attribute=malloc -Wsuggest-attribute=returns_nonnull -MT liblzma_la-common.lo -MD -MP -MF .deps/liblzma_la-common.Tpo -c common/common.c -o liblzma_la-common.o >/dev/null 2>&1
make[4]: *** [Makefile:1137: liblzma_la-common.lo] Error 1
make[4]: Leaving directory '/home/sam/git/xz/src/liblzma'
make[3]: *** [Makefile:1758: all-recursive] Error 1
make[3]: Leaving directory '/home/sam/git/xz/src/liblzma'
make[2]: *** [Makefile:427: all-recursive] Error 1
make[2]: Leaving directory '/home/sam/git/xz/src'
make[1]: *** [Makefile:595: all-recursive] Error 1
make[1]: Leaving directory '/home/sam/git/xz'
make: *** [Makefile:485: all] Error 2

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

Indeed, if I run the failing command manually:
$ gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/liblzma/api -I../../src/liblzma/common -I../../src/liblzma/check -I../../src/liblzma/lz -I../../src/liblzma/rangecoder -I../../src/liblzma/lzma -I../../src/liblzma/delta -I../../src/liblzma/simple -I../../src/common -DTUKLIB_SYMBOL_PREFIX=lzma_ -pthread -fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs -Wshift-overflow=2 -Wstrict-overflow=3 -Walloc-zero -Wduplicated-cond -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wdate-time -Wsign-conversion -Wfloat-conversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wmissing-variable-declarations -Werror -O3 -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wsuggest-attribute=cold -Wsuggest-attribute=malloc -Wsuggest-attribute=returns_nonnull -MT liblzma_la-common.lo -MD -MP -MF .deps/liblzma_la-common.Tpo -c common/common.c -o liblzma_la-common.o
common/common.c: In function ‘lzma_version_string’:
common/common.c:27:1: error: function might be candidate for attribute ‘returns_nonnull’ [-Werror=suggest-attribute=returns_nonnull]
   27 | lzma_version_string(void)
      | ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

With -fPIC, IPA doesn't end up doing attribute discovery. Without it, it does. This behaviour is insane. It needs to be patched out in elt-patches at least.
Comment 5 Larry the Git Cow gentoo-dev 2024-04-15 06:18:52 UTC
The bug has been referenced in the following commit(s):

commit 9d08565368ff450c17a27bd0394a814d0aa928e7
Author:     Sam James <>
AuthorDate: 2024-04-15 06:17:43 +0000
Commit:     Sam James <>
CommitDate: 2024-04-15 06:17:43 +0000

    patches/verbose-pic: new patch to not suppress compiler output (!)
    Signed-off-by: Sam James <>               |  2 +-
 patches/verbose-pic/2.4.7 | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletion(-)
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-15 06:21:44 UTC
Fixed in elt-patches. We should still report this upstream though.