osx - Building a cross compile of binutils on OS X Yosemite -


i'm trying build binutils generating mips code on mac os x.

i found site (http://www.theairportwiki.com/index.php/building_a_cross_compile_of_gcc_for_mips_on_os_x) how build gcc 4.8.x on mac os x host mips target, , followed instructions.

i install gcc-4.8 brew, , installed source code of binutils , gcc. compilation option setup.

$ export cc=/usr/local/bin/gcc-4.8 $ export cxx=/usr/local/bin/g++-4.8 $ export cpp=/usr/local/bin/cpp-4.8 $ export ld=/usr/local/bin/gcc-4.8 $ export prefix=/opt/cross/gcc-mips $ export cflags=-wno-error=deprecated-declarations 

then configure, , make bintuils.

the issue after building static libraries have error message archive not built x86_64, , have bunch of undefined symbol error.

ignoring file ./../intl/libintl.a, file built archive not architecture being linked (x86_64): ./../intl/libintl.a  undefined symbols architecture x86_64:   "__bfd_abort", referenced from:       _fix_new_internal in write.o       _size_seg in write.o 

googling find need setup ar (archive) variable https://github.com/tpoechtrager/osxcross/issues/11. added export ar=/usr/local/bin/gcc-ar-4.8, have error message because gcc-ar-4.8 doesn't work.

/usr/local/bin/gcc-ar-4.8  /usr/local/bin/gcc-ar-4.8: cannot find plugin 'liblto_plugin.so' 

googling again find gcc-ar doesn't work mac os x (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56893).

gcc-ar use newer gnu binutils only ar supports plugins.   apple's ar not support plugins (though made to; different plugin interface gnu bfd  plugin interface gcc supports right now). 

i created dumb 'liblto_plugin.so' file in /usr/local/cellar/gcc48/4.8.4/libexec/gcc/x86_64-apple-darwin14.3.0/4.8.4 directory suppress error message, in case looks /usr/ar invoked when use /usr/bin/gcc-ar-4.8 same architecture , undefined symbols error.

how solve these issues? how build cross compiler tools (gcc , binutils) on mac os x?

the static library generator mac os x not ar, libtool -static. there post - static library link issue mac os x: symbol(s) not found architecture x86_64.

the binutils has multiple libraries linked statically. replaced ar rc command libtool -static -o static libraries not cause errors.

in doing so, had make 2 modifications also.

  1. some library generate libtool script conflict mac os x's libtool, had rename script.
  2. some object files not contain symbols, had remove objects.

then binaries without issue.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -