Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I am using the commands give in the cross compiler tutorial and have mpfr in the gcc directory so gcc will compile it with it and have latest version of gmp.
if there is a script which works on snow leopard for making a cross compiler for i686 or i586 elf then can you also tell me that because that would help alot too.
ld: duplicate symbol _init_inline_once in libbackend.a(tree-inline.o) and tree-inline.o
Apparently tree-inline.o gets linked twice, once through libbackend.a and once directly.
I assume that the build process for MacOS doesn't deviate from the "normal" process enough to result in errors like this, so I wonder where the duplication comes from. In your description, two things spring to mind:
when you say "copy gcc-g++ into gcc src directory", do you unpack the gcc-g++ tarball in a subdirectory of the GCC tree? Note that the cross-compiler tutorial says "download both gcc-core and gcc-g++, and unpack them in the same directory".
try building MPFR seperately instead of copying it into the GCC source tree.
Do the problems still persist?
Every good solution is obvious once you've found it.
ld: duplicate symbol _init_inline_once in libbackend.a(tree-inline.o) and tree-inline.o
Apparently tree-inline.o gets linked twice, once through libbackend.a and once directly.
I assume that the build process for MacOS doesn't deviate from the "normal" process enough to result in errors like this, so
I got the same problem following the guide as I always have. I can't remember the exact workaround I used but I think I let it get to the point of failure and then removed the offending .o files from a file as to prevent it from failing.
the bug with apple's gcc is that it doesn't ignor duplicate symbols in static libraries like it should. and I do unpack them into the same directory.
I really want to get this to work because I've been making my operating system in vmware fusion linux and would like to do it on mac where I'm used to the os. (host os)
After a couple google searches today I found that, any work around? like would deleting the file help? or changing the make file?
Edit: mpfr doesn't compile on snow leopard either so I just put it in the directory and let gcc do it. it seems to compile mpfr fine when I do that.
Edit: nevermind found it
Last edited by bluechill on Thu Oct 22, 2009 6:23 am, edited 1 time in total.
Solar wrote:Apparently a known bug. If I skimmed this bug report correctly, it's a bug in the XCode linker. The report also provides patches / workarounds.
Every good solution is obvious once you've found it.
gcc -g -O2 -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a
ld: warning: in ../libiberty/libiberty.a, file is not of required architecture
Undefined symbols:
"_xmalloc_set_program_name", referenced from:
_initialize in fixincl.o
"_xmalloc", referenced from:
_process in fixincl.o
_wrap_fix in fixfixes.o
_run_shell in server.o
"_xrealloc", referenced from:
_run_shell in server.o
_run_shell in server.o
_load_file_data in fixlib.o
_load_file_data in fixlib.o
"_xregexec", referenced from:
_egrep_test in fixincl.o
_process in fixincl.o
_process in fixincl.o
_machine_name_test in fixtests.o
_machine_name_test in fixtests.o
_gnu_type_fix in fixfixes.o
_wrap_fix in fixfixes.o
_machine_name_fix in fixfixes.o
_machine_name_fix in fixfixes.o
_char_macro_def_fix in fixfixes.o
_char_macro_use_fix in fixfixes.o
_format_fix in fixfixes.o
"__sch_toupper", referenced from:
_gnu_type_fix in fixfixes.o
_wrap_fix in fixfixes.o
"__sch_istable", referenced from:
_initialize in fixincl.o
_process in fixincl.o
_process in fixincl.o
_main in fixincl.o
_wrap_fix in fixfixes.o
_char_macro_def_fix in fixfixes.o
_char_macro_use_fix in fixfixes.o
_format_fix in fixfixes.o
_run_shell in server.o
"_xcalloc", referenced from:
_run_compiles in fixincl.o
_run_shell in server.o
"_xregerror", referenced from:
_compile_re in fixlib.o
"_xstrerror", referenced from:
_create_file in fixincl.o
_load_file in fixincl.o
_load_file in fixincl.o
_initialize in fixincl.o
_process in fixincl.o
_process in fixincl.o
_process in fixincl.o
_process in fixincl.o
_chain_open in procopen.o
_load_file_data in fixlib.o
"_fdopen_unlocked", referenced from:
_create_file in fixincl.o
_load_file in fixincl.o
_process in fixincl.o
_proc2_fopen in procopen.o
_proc2_fopen in procopen.o
"_freopen_unlocked", referenced from:
_initialize in fixincl.o
_main in fixincl.o
"_xregcomp", referenced from:
_compile_re in fixlib.o
"_xstrdup", referenced from:
_run_shell in server.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [full-stamp] Error 1
make[1]: *** [all-fixincludes] Error 2
make: *** [all] Error 2
when I compile gcc 4.4.2 with the patch on the site there.
know why now?
I'm compiling same way on os dev gcc cross compiler tutorial non 64 bit