Hmm, I tried upgrading to binutils 2.16 but still the segfault... It's strange since I never had problems with binutils, I'd probably would have never discovered the issue if I had not seen this thread.

@Teutzz: I'm using your same LDFLAGS (apart from -as-needed), so I guess the problem is not there. Does anyone know what commands are executed when executing the LD_DEBUG="..." command?

_________________

Albert Einstein wrote:

I consider it [...] urgently necessary for [...] workers to get together, both to protect their own economic status and [...] to secure their influence in the political field.

As i understand other people's posts on the subject, & the 'ld' man-page, the -O optimisation-flag has only two states: zero or not-zero. So setting it to 1, 2, 3, or whatever won't make a blind bit of difference, as long as it's a number greater than zero. It's not the same principle as CFLAGS, so there won't be a size-option, either._________________"Anyone who goes to see a psychiatrist should have their head examined!"

I've read this thread and i give you back my experience to have play a lot with my LDFLAGS this last year:

I've recompiled a whole system with this: LDFLAGS="-Wl,-O1"
At the first glaze no problem at all... But on the next reboot, system didn't finish to boot up.
It was looking for some libs on some partition that weren't yet mounted at boot.
It seems where is some problem with some library that are on /usr/*/lib and not on /lib that are required at boot.
It was enough a long time ago but i remember to have copy some library on /usr/*/lib without have mounted /usr
so no problem at boot time to look for them but i think it's a dirty hack...

So just be warned if you have a full separated partition scheme as i have about the use of LDFLAGS on a whole system.

Think about gpm libraries for reiserfs binaries was one of theses problems. ( i never understood the need of gpm for reiserfs !)

At the first glaze no problem at all... But on the next reboot, system didn't finish to boot up.
It was looking for some libs on some partition that weren't yet mounted at boot.
It seems where is some problem with some library that are on /usr/*/lib and not on /lib that are required at boot.

WTF?! How does the location where libraries are installed in the system depend on LDFLAGS

[*]--sort-common
This is to prevent gaps between symbols due to alignment constraints, presumably increasing efficiency layout.

Actually, it seems that it is the other way around.

-sort-common
Normally, when ld places the global common symbols
in the appropriate output sections, it sorts them
by size. First come all the one byte symbols, then
all the two bytes, then all the four bytes, and
then everything else. This is to prevent gaps be-
tween symbols due to alignment constraints. This
option disables that sorting._________________Viper-Sources Maintainer || nesl247 Projects || vipernicus.org blog

[*]--sort-common
This is to prevent gaps between symbols due to alignment constraints, presumably increasing efficiency layout.

Actually, it seems that it is the other way around.

-sort-common
Normally, when ld places the global common symbols
in the appropriate output sections, it sorts them
by size. First come all the one byte symbols, then
all the two bytes, then all the four bytes, and
then everything else. This is to prevent gaps be-
tween symbols due to alignment constraints. This
option disables that sorting.

erm... no!

man binutils-2.17.50.0.6 wrote:

--sort-common
This option tells ld to sort the common symbols by size when it
places them in the appropriate output sections

other than this, /me still wonders why --enable-new-dtags has been removed from the original post.

edit : @zentoo, definitly not, you probably were using a statical prog and forgot about this.

I've been using these with the advanced Gentoo install method and overlay by nesl247 (previously know as Evolution Mission). Works great for me, and the the few packages that have problems with --as-needed or -znow can be taken care of by entries in an /etc/portage/bashrc.nesl247 file, as shown below.
---------------------------------------------------------------------------------------------------
# Packages in this array remove --as-needed.
as_needed_packages=(
${as_needed_packages[*]}
media-video/mjpegtools
kde-base/kdemultimedia
kde-base/kdemultimedia-kioslaves
net-mail/courier-imap
media-sound/cdparanoia
mail-client/evolution
media-libs/imlib
)

Correct. When you copy it from /etc/make.conf and paste it into the forum and add the code tags, the numeral one (1) and a lower case L really look almost identical. You have to look really close to see the numeral one has its top part at a slight downward angle, whereas the lower case L is horizontal._________________Main box- AsRock x370 Gaming K4
Ryzen 1700, 3.0GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.26-r5, gcc-7.3.0 kernel-4.15.4-gentoo USE=experimental