Hello,
I ran into an issue with the LTO merges when updating to current trunk. 
The problem is that my target calls a few functions/uses some data structures
in the gcc directory: c_language, paragma_lex, c_register_pragma, etc.

gcc -m32  -g -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings 
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute 
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings 
-Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H  -o lto1 \
                lto/lto-lang.o lto/lto.o lto/lto-elf.o attribs.o main.o 
tree-browser.o libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a   
-L/projects/firepath/tools/work/bmei/packages/gmp/4.3.0/lib 
-L/projects/firepath/tools/work/bmei/packages/mpfr/2.4.1/lib -lmpfr -lgmp 
-rdynamic -ldl  -L../zlib -lz 
-L/projects/firepath/tools/work/bmei/packages/libelf/lib -lelf 
../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  
-lelf

When compiling for lto1 in above step, I have many linking errors consequently.
I tried to add some extra object files like c-common.o, c-pragma.o, etc into
lto/Make-lang.in. More linking errors are produced. One problem is that lto
code redefines some data exist in the main code: flag_no_builtin, flag_isoc99
lang_hooks, etc, which prevent it from linking with object files in main 
directory. 

What is the clean solution for this? Thanks in advance.

Cheers,
Bingfeng Mei


Reply via email to