View previous topic :: View next topic |
Author |
Message |
Hasw n00b
Joined: 31 Dec 2004 Posts: 68 Location: Germany
|
Posted: Tue May 31, 2005 11:25 pm Post subject: |
|
|
Hm, I'm getting a Segmentation fault:
Code: |
hasw@hasw hasw $ LD_DEBUG=statistics sh -c true
26096:
26096: runtime linker statistics:
26096: total startup time in dynamic loader: 595306 clock cycles
26096: time needed for relocation: 289777 clock cycles (48.6%)
Segmentation fault
hasw@hasw hasw $
|
sys-devel/binutils 2.15.92.0.2-r7
sys-libs/glibc 2.3.4.20041102-r1 |
|
Back to top |
|
|
Bitspyer Apprentice
Joined: 17 Dec 2002 Posts: 211 Location: Mainz, Germany
|
Posted: Wed Jun 01, 2005 9:33 am Post subject: |
|
|
Hmmm I'm asking me, what is the better solution:
LDFLAG or prelink? Or both together??? _________________ Der Weg zur Dunklen Seite... Schneller er ist, verführerischer, leichter. |
|
Back to top |
|
|
Dark_Cloud n00b
Joined: 29 Jun 2003 Posts: 27
|
Posted: Wed Jun 01, 2005 4:45 pm Post subject: |
|
|
Bitspyer wrote: | Hmmm I'm asking me, what is the better solution:
LDFLAG or prelink? Or both together??? |
you can use both. |
|
Back to top |
|
|
yardbird l33t
Joined: 20 Apr 2002 Posts: 689 Location: nl.leiden
|
Posted: Fri Jun 03, 2005 1:40 am Post subject: |
|
|
Hasw wrote: | Hm, I'm getting a Segmentation fault:
Code: |
hasw@hasw hasw $ LD_DEBUG=statistics sh -c true
26096:
26096: runtime linker statistics:
26096: total startup time in dynamic loader: 595306 clock cycles
26096: time needed for relocation: 289777 clock cycles (48.6%)
Segmentation fault
hasw@hasw hasw $
|
|
Same here... do you have custom LDFLAGS set in make.conf? _________________
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. |
http://www.bluescarni.info |
|
Back to top |
|
|
teutzz Guru
Joined: 22 Apr 2004 Posts: 333 Location: .ro
|
Posted: Fri Jun 03, 2005 7:11 am Post subject: |
|
|
Code: | Teutzz teutzz # LD_DEBUG=statistics sh -c true
17293:
17293: runtime linker statistics:
17293: total startup time in dynamic loader: 411310 clock cycles
17293: time needed for relocation: 14399 clock cycles (3.5%)
17293: number of relocations: 0
17293: number of relocations from cache: 21
17293: number of relative relocations: 0
17293: time needed to load objects: 236055 clock cycles (57.3%)
17293:
17293: runtime linker statistics:
17293: final number of relocations: 65
17293: final number of relocations from cache: 21 | and in my make.conf: Code: | Teutzz teutzz # cat /etc/make.conf | grep LDFLAGS
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s -Wl,--as-needed" | and the whole system is prelinked _________________ Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz |
|
Back to top |
|
|
yardbird l33t
Joined: 20 Apr 2002 Posts: 689 Location: nl.leiden
|
Posted: Fri Jun 03, 2005 11:19 am Post subject: |
|
|
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. |
http://www.bluescarni.info |
|
Back to top |
|
|
j-m Retired Dev
Joined: 31 Oct 2004 Posts: 975
|
Posted: Thu Jun 09, 2005 9:03 am Post subject: |
|
|
Kyrra wrote: | I had the same problem with using LDFLAGS to compile Emacs as listed in a post higher in this thread. But everything else I've compiled on my system hasn't had a problem with the LDFLAGS yet. |
For emacs, you need only:
Probably the only package that does not interpret -Wl as an option passed to the linker. |
|
Back to top |
|
|
wel Apprentice
Joined: 03 Sep 2003 Posts: 207
|
Posted: Fri Jun 10, 2005 10:46 pm Post subject: |
|
|
Anyone has tried something bigger than -O1? I mean, -O2 or -Os... |
|
Back to top |
|
|
taipan67 l33t
Joined: 04 Dec 2004 Posts: 866 Location: England (i'm told...)
|
Posted: Sat Jun 11, 2005 7:09 pm Post subject: |
|
|
wel wrote: | Anyone has tried something bigger than -O1? I mean, -O2 or -Os... |
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!" |
|
Back to top |
|
|
Zentoo Apprentice
Joined: 18 Nov 2002 Posts: 195 Location: /dev/console
|
Posted: Wed Jun 15, 2005 12:52 pm Post subject: Notice if u use specific LDFLAGS |
|
|
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 !) |
|
Back to top |
|
|
j-m Retired Dev
Joined: 31 Oct 2004 Posts: 975
|
Posted: Wed Jun 15, 2005 2:23 pm Post subject: Re: Notice if u use specific LDFLAGS |
|
|
Tuttle wrote: |
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 |
|
Back to top |
|
|
MaratIK n00b
Joined: 02 Apr 2003 Posts: 20 Location: Moscow, Russia
|
Posted: Fri Feb 24, 2006 3:45 am Post subject: --relax will not work on some packages |
|
|
ld flag --relax conficts with -r, so they cannot use both.
Package where it occured is glibc-2.3.5.
It is strongly not recommended include -Wl,--relax into LDFLAGS |
|
Back to top |
|
|
MaratIK n00b
Joined: 02 Apr 2003 Posts: 20 Location: Moscow, Russia
|
Posted: Fri Feb 24, 2006 3:59 am Post subject: |
|
|
schrepfler wrote: | Are there any new tips for the use of LDFLAGS, what are some good configs for the 3.4, 3.4 and 4.0 compilers? |
ld is not the part of gcc, but binutils. Tips the same as is for previous versions of gcc. |
|
Back to top |
|
|
MaratIK n00b
Joined: 02 Apr 2003 Posts: 20 Location: Moscow, Russia
|
Posted: Mon Aug 28, 2006 4:02 pm Post subject: |
|
|
My settings for LDFLAGS:
Code: | LDFLAGS="-Wl,-O1,--sort-common,--enable-new-dtags,-zdynsort,-Bdirect,-hashvals" |
Some explanation of last 3 settings can be found here |
|
Back to top |
|
|
vipernicus Veteran
Joined: 17 Jan 2005 Posts: 1462 Location: Your College IT Dept.
|
Posted: Mon Sep 25, 2006 9:27 pm Post subject: Re: LDFLAGS Central |
|
|
taviso wrote: | [*]--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 |
|
Back to top |
|
|
luminoso n00b
Joined: 13 Oct 2005 Posts: 60 Location: Portugal, Aveiro
|
Posted: Thu Oct 05, 2006 12:08 pm Post subject: |
|
|
Code: |
$ LD_DEBUG=statistics sh -c true
28385:
28385: runtime linker statistics:
28385: total startup time in dynamic loader: 1578708 clock cycles
28385: time needed for relocation: 29708 clock cycles (1.8%)
28385: number of relocations: 0
28385: number of relocations from cache: 29
28385: number of relative relocations: 0
28385: time needed to load objects: 1107048 clock cycles (70.1%)
28385:
28385: runtime linker statistics:
28385: final number of relocations: 0
28385: final number of relocations from cache: 29
|
Code: |
grep LDFL /etc/make.conf
LDFLAGS="-Wl,-O1"
|
And no problems at all.
What should i care? time needed to load or time needed for relocation? |
|
Back to top |
|
|
Enlight Advocate
Joined: 28 Oct 2004 Posts: 3519 Location: Alsace (France)
|
Posted: Sun Nov 26, 2006 3:24 am Post subject: Re: LDFLAGS Central |
|
|
vipernicus wrote: | taviso wrote: | [*]--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. |
|
Back to top |
|
|
Dralnu Veteran
Joined: 24 May 2006 Posts: 1919
|
Posted: Sat Mar 03, 2007 8:04 pm Post subject: |
|
|
Has anyone else messed with LDFLAGS in awhile? I'm going through and sorting out what might be nice and what might not be, and just want to know if there is any new news.
Edit: Um, have LDFLAGS been removed for some odd reason? _________________ The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner. |
|
Back to top |
|
|
wrc1944 Advocate
Joined: 15 Aug 2002 Posts: 3433 Location: Gainesville, Florida
|
Posted: Sat Mar 03, 2007 11:10 pm Post subject: |
|
|
Mine are currently Code: | LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=both -Wl,-znow" | on several boxes.
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
)
LDFLAGS="${LDFLAGS:-$( grep ^LDFLAGS /etc/make.conf | sed 's/LDFLAGS="//' | sed 's/"//')}"
for i in ${as_needed_packages[*]}
do
case ${CATEGORY}/${PN} in
${i})
LDFLAGS="$( echo ${LDFLAGS} | sed 's/-Wl,--as-needed//')"
break
;;
esac
done
# Packages in this array remove -znow.
znow_packages=(
${znow_packages[*]}
dev-python/gst-python
x11-base/xorg-server
x11-drivers/ati-drivers
)
for i in ${znow_packages[*]}
do
case ${CATEGORY}/${PN} in
${i})
LDFLAGS="$( echo ${LDFLAGS} | sed 's/-Wl,-znow//')"
break
;;
esac
done
export LDFLAGS=$( echo ${LDFLAGS} ) _________________ Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.2 USE=experimental python3_11 |
|
Back to top |
|
|
Dralnu Veteran
Joined: 24 May 2006 Posts: 1919
|
Posted: Sun Mar 04, 2007 12:37 am Post subject: |
|
|
Ran into a problem. its -W, not 1, but a lower case L. _________________ The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner. |
|
Back to top |
|
|
wrc1944 Advocate
Joined: 15 Aug 2002 Posts: 3433 Location: Gainesville, Florida
|
Posted: Sun Mar 04, 2007 2:38 am Post subject: |
|
|
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 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.2 USE=experimental python3_11 |
|
Back to top |
|
|
webdawg n00b
Joined: 26 Jul 2006 Posts: 34
|
Posted: Tue Jun 12, 2007 3:58 am Post subject: I had some ldflags that broke gst plugins. had to comment t |
|
|
I had some ldflags that broke gst plugins. had to comment them out. |
|
Back to top |
|
|
ConiKost Developer
Joined: 11 Jan 2005 Posts: 1365
|
Posted: Thu Jun 21, 2007 8:52 pm Post subject: |
|
|
I am using atm this:
Code: | LDFLAGS="-Wl,-O1 -Wl,-z,now -Wl,--as-needed -Wl,--enable-new-dtags -Wl,--sort-common -s" |
works fine for me. |
|
Back to top |
|
|
enderandrew l33t
Joined: 25 Oct 2005 Posts: 731
|
Posted: Thu Jun 28, 2007 4:05 am Post subject: |
|
|
ConiKost wrote: | I am using atm this:
Code: | LDFLAGS="-Wl,-O1 -Wl,-z,now -Wl,--as-needed -Wl,--enable-new-dtags -Wl,--sort-common -s" |
works fine for me. |
Don't forget --hash-style=both
And I'm working on a toolchain overlay that will add back in support for -Bdirect among many other things! _________________ Nihilism makes me smile. |
|
Back to top |
|
|
gimpel Advocate
Joined: 15 Oct 2004 Posts: 2720 Location: Munich, Bavaria
|
Posted: Thu Jun 28, 2007 7:40 am Post subject: |
|
|
Code: | LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common" |
on binutils-2.17.50.0.10 here.
No problems. _________________ http://proaudio.tuxfamily.org/wiki - pro-audio software overlay
|
|
Back to top |
|
|
|