So, I need to disable the link-time optimizer in LD (and ideally disable it in GCC too, to avoid unusable bloat in the generated object files). I also need to do this without use of any command-line flags anywhere. Is there by any chance any way to do this without re-configuring the GCC and binutils build? (I.e. without re-running ./configure and fitting the results into the tree again myself -- or is there a handy script that will do this reliably?) I suppose I could hack the command-line processing code to change the defaults (as if the options were given on the command-line), but is there any other way? FYI, I need to do this for several reasons, the most pressing of which is libtool being stupid (or just being). The next reason is so that I can try building the whole toolchain into a crunchgen binary. (BTW, while I really like the idea of LTO, I truly detest the idea of using a plugin in the linker. What a horrid hack.) Also, BTW, the "-fno-lto" option to GCC causes it to create a bogus command-line for 'ld'. For now I get by with '-fno-use-linker-plugin' set in LDFLAGS, but as I say I need to do this without command-line flags. 13:16 [221] $ make thello gcc -fno-lto -fno-use-linker-plugin -fno-strict-aliasing -pipe -fstack-protector -Wstack-protector --param ssp-buffer-size=1 -g -std=gnu99 -Wall -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wcast-qual -Wpointer-arith -Wshadow -Wstrict-prototypes -Wextra -Wcast-align -Wchar-subscripts -Wconversion -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wformat-extra-args -Wundef -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wno-format-y2k -Wtraditional-conversion -Wunreachable-code -Wstrict-overflow=5 -fstack-protector-all -D_FORTIFY_SOURCE=2 -static -fno-use-linker-plugin -Wl,--warn-shared-textrel -o thello thello.c ld: -f may not be used without -shared *** Error code 1 Stop. make: stopped in /home/more/woods/src With 'gcc -v' you can see the 'ld' command line as: ld -fno-lto -dc -dp -e _start -static -o thello /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbeginT.o --warn-shared-textrel /var/tmp//ccCEQcxS.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/crtend.o /usr/lib/crtn.o As far as I understand the '-fno-lto' should simply not be there. -- Greg A. Woods Planix, Inc. <woods%planix.com@localhost> +1 250 762-7675 http://www.planix.com/
Attachment:
pgpCvmF1FuskW.pgp
Description: PGP signature