This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/15648] Support building glibc with -flto.

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
             Status|WAITING                     |NEW
            Summary|multiple definition of      |Support building glibc with
                   |`__lll_lock_wait_private'   |-flto.
           Severity|normal                      |enhancement

--- Comment #4 from Carlos O'Donell <carlos at redhat dot com> ---
This doesn't work at all for me for entirely different reasons.

I expect that you haven't actually tried to use -flto.

glibc master is currently unbuildable with -flto because of:

You should always see:
checking for .preinit_array/.init_array/.fini_array support... no
configure: error: Need linker with .init_array/.fini_array support.

This is because -flto throws out the .init_array support.

A potential fix is:
diff --git a/ b/
index 8b11081..415e777 100644
--- a/
+++ b/
@@ -1383,7 +1383,7 @@ AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array
               libc_cv_initfini_array, [dnl
 int foo (void) { return 1; }
-int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
+int (*fp) (void) __attribute__ ((section (".init_array"), used)) = foo;
   [if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then

However, given that nobody has built with -flto it's going to require
considerable work to make it happen.

I'm retitling and marking as enhancement.

You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]