For a lot of us, many POSIX-related utilities, tools, and libraries are handled routinely by Macports, so I haven’t seen this kind of question come up on the PPC forum. This question involves building from source code without using a ports handler like macports or homebrew. How come? Because this is the unique situation of running an early build of Darwin10/Snow Leopard on a PowerPC Mac.
The challenge:
I’m trying to compile GCC 4.6.4 (or any GCC revision from 4.6 onward) from source in order to finally get irssi compiled (also from source) and running under 10.6 (Build 10A96) for PowerPC.
To do so, of course, requires building up (in what feels like ascending a helix, slowly) all kinds of utilities, tools, and libraries. (Eventually, I’ll share the long list of manual builds on the Snow Leopard for PowerPC thread.) For the most part, I think I’ve more or less done most of that. By default, the Xcode 3.2 shipped with Build 10A96 comes bundled with an Apple-optimized gcc 4.2.1. For compiling/building many of the aforementioned components, this has been sufficient.
What’s hanging me up is irssi requires at least gcc 4.6, as it invokes the following (“pragma”, which doesn’t become required until gcc 4.6) before the build errors out:
So, in trying to build GCC 4.6, the compile process makes it some percentage of the way through before halting on the following error:
Everything which follows is the abort itself.
Several years ago, there appeared to be a lead on how to rectify this issue, but that lead is now a dead end. Another lead, in Japanese, suggested preceding the configure/build steps by first running an “export ARCHFLAGS” — though in my case I tried both the suggestion, verbatim, as well as just running it with the last part (i.e., “-arch ppc” only):
Has anyone here ever run across anything like this, and if so, have you managed to find any kind of workaround?
UPDATE: I should also add I’ve tried the following build flags suggested by the GNU configure page, and the outcome remains identical:
UPDATE THE SECOND: In what amounts to throwing stuff at a wall and seeing what sticks to it, I’ve been trying various configure flags which may or may not have an impact on the make process. I honestly don’t know what I’m doing, other than feeling like a naif. At present, this set of configure flags is yielding a different make error:
(As part of experimentation, I stripped away the “10.0.0d1” to make it simply “10”. For the most part, this seems to try building in a directory named “powerpc-apple-darwin10”.)
The current flavour of errors have all included an “error 77”, which departs from earlier:
I’ll keep at it after some rest and when I have some time to return to it, but I’m not sure what to try next.
The challenge:
I’m trying to compile GCC 4.6.4 (or any GCC revision from 4.6 onward) from source in order to finally get irssi compiled (also from source) and running under 10.6 (Build 10A96) for PowerPC.
To do so, of course, requires building up (in what feels like ascending a helix, slowly) all kinds of utilities, tools, and libraries. (Eventually, I’ll share the long list of manual builds on the Snow Leopard for PowerPC thread.) For the most part, I think I’ve more or less done most of that. By default, the Xcode 3.2 shipped with Build 10A96 comes bundled with an Apple-optimized gcc 4.2.1. For compiling/building many of the aforementioned components, this has been sufficient.
What’s hanging me up is irssi requires at least gcc 4.6, as it invokes the following (“pragma”, which doesn’t become required until gcc 4.6) before the build errors out:
[11/278] Compiling C object src/core/libcore.a.p/channels.c.o
In file included from ../src/core/channels.c:23:
./irssi/src/core/misc.h:13: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
./irssi/src/core/misc.h:20: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
So, in trying to build GCC 4.6, the compile process makes it some percentage of the way through before halting on the following error:
ld warning: in /usr/lib/dylib1.o, missing required architecture ppc64 in file
ld warning: in libgcc.a, file is not of required architecture
ld warning: in /usr/lib/libc.dylib, missing required architecture ppc64 in file
Everything which follows is the abort itself.
# @multilib_flags@ is still needed because this may use
# /opt/gcc-4.6/host-powerpc-apple-darwin10.0.0d1/gcc/xgcc -B/opt/gcc-4.6/host-powerpc-apple-darwin10.0.0d1/gcc/ -B/usr/local/powerpc-apple-darwin10.0.0d1/bin/ -B/usr/local/powerpc-apple-darwin10.0.0d1/lib/ -isystem /usr/local/powerpc-apple-darwin10.0.0d1/include -isystem /usr/local/powerpc-apple-darwin10.0.0d1/sys-include and -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -Wa,-force_cpusubtype_ALL -pipe -mmacosx-version-min=10.4 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector directly.
# @multilib_dir@ is not really necessary, but sometimes it has
# more uses than just a directory name.
/bin/sh ../../.././libgcc/../mkinstalldirs ppc64
/opt/gcc-4.6/host-powerpc-apple-darwin10.0.0d1/gcc/xgcc -B/opt/gcc-4.6/host-powerpc-apple-darwin10.0.0d1/gcc/ -B/usr/local/powerpc-apple-darwin10.0.0d1/bin/ -B/usr/local/powerpc-apple-darwin10.0.0d1/lib/ -isystem /usr/local/powerpc-apple-darwin10.0.0d1/include -isystem /usr/local/powerpc-apple-darwin10.0.0d1/sys-include -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -Wa,-force_cpusubtype_ALL -pipe -mmacosx-version-min=10.4 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector -dynamiclib -nodefaultlibs -install_name /usr/local/lib/libgcc_s.1.dylib -single_module -o ppc64/libgcc_s.dylib -Wl,-exported_symbols_list,libgcc.map -compatibility_version 1 -current_version 1.0 -g -O2 -m64 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _enable_execute_stack_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixtfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _fixunstfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatditf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _floatunditf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o darwin-tramp_s.o ppc64-fp_s.o darwin-64_s.o darwin-ldouble_s.o darwin-world_s.o unwind-dw2_s.o unwind-dw2-fde-darwin_s.o unwind-sjlj_s.o unwind-c_s.o darwin-fallback_s.o emutls_s.o libgcc.a -lc
ld warning: in /usr/lib/dylib1.o, missing required architecture ppc64 in file
ld warning: in libgcc.a, file is not of required architecture
ld warning: in /usr/lib/libc.dylib, missing required architecture ppc64 in file
Undefined symbols:
"_mprotect", referenced from:
___enable_execute_stack in _enable_execute_stack_s.o
___enable_execute_stack in _enable_execute_stack_s.o
"_pthread_mutex_unlock", referenced from:
___emutls_get_address in emutls_s.o
"__keymgr_get_and_lock_processwide_ptr", referenced from:
_live_image_destructor in unwind-dw2-fde-darwin_s.o
__Unwind_Find_FDE in unwind-dw2-fde-darwin_s.o
__Unwind_Find_FDE in unwind-dw2-fde-darwin_s.o
"_getpagesize", referenced from:
___enable_execute_stack in _enable_execute_stack_s.o
"_pthread_once", referenced from:
_uw_init_context_1 in unwind-dw2_s.o
___emutls_get_address in emutls_s.o
"__keymgr_unlock_processwide_ptr", referenced from:
__Unwind_Find_FDE in unwind-dw2-fde-darwin_s.o
"_pthread_key_create", referenced from:
_emutls_init in emutls_s.o
"_realloc", referenced from:
___emutls_get_address in emutls_s.o
"_malloc", referenced from:
_search_object in unwind-dw2-fde-darwin_s.o
_search_object in unwind-dw2-fde-darwin_s.o
___register_frame in unwind-dw2-fde-darwin_s.o
___register_frame_table in unwind-dw2-fde-darwin_s.o
___emutls_get_address in emutls_s.o
___emutls_get_address in emutls_s.o
"__cpu_has_altivec", referenced from:
__cpu_has_altivec$non_lazy_ptr in darwin-world_s.o
"_getsectdatafromheader_64", referenced from:
__Unwind_Find_FDE in unwind-dw2-fde-darwin_s.o
"_calloc", referenced from:
__Unwind_Find_FDE in unwind-dw2-fde-darwin_s.o
__Unwind_Find_FDE in unwind-dw2-fde-darwin_s.o
___emutls_get_address in emutls_s.o
"_pthread_getspecific", referenced from:
___emutls_get_address in emutls_s.o
"_free", referenced from:
_search_object in unwind-dw2-fde-darwin_s.o
___deregister_frame_info_bases in unwind-dw2-fde-darwin_s.o
_live_image_destructor in unwind-dw2-fde-darwin_s.o
_live_image_destructor in unwind-dw2-fde-darwin_s.o
___deregister_frame in unwind-dw2-fde-darwin_s.o
_emutls_destroy in emutls_s.o
_emutls_destroy in emutls_s.o
"_pthread_mutex_lock", referenced from:
___emutls_get_address in emutls_s.o
"_pthread_setspecific", referenced from:
___emutls_get_address in emutls_s.o
___emutls_get_address in emutls_s.o
"_abort", referenced from:
___absvdi2 in _absvsi2_s.o
___absvsi2 in _absvsi2_s.o
___absvti2 in _absvdi2_s.o
___addvdi3 in _addvsi3_s.o
___addvsi3 in _addvsi3_s.o
___addvti3 in _addvdi3_s.o
___subvdi3 in _subvsi3_s.o
___subvsi3 in _subvsi3_s.o
___subvti3 in _subvdi3_s.o
___mulvdi3 in _mulvsi3_s.o
___mulvsi3 in _mulvsi3_s.o
___mulvti3 in _mulvdi3_s.o
___negvdi2 in _negvsi2_s.o
___negvsi2 in _negvsi2_s.o
___negvti2 in _negvdi2_s.o
___trampoline_setup in darwin-tramp_s.o
_read_encoded_value_with_base in unwind-dw2_s.o
_execute_stack_op in unwind-dw2_s.o
_execute_stack_op in unwind-dw2_s.o
_execute_cfa_program in unwind-dw2_s.o
_execute_cfa_program in unwind-dw2_s.o
_uw_frame_state_for in unwind-dw2_s.o
_uw_frame_state_for in unwind-dw2_s.o
_uw_install_context_1 in unwind-dw2_s.o
_uw_update_context_1 in unwind-dw2_s.o
_uw_update_context in unwind-dw2_s.o
__Unwind_RaiseException_Phase2 in unwind-dw2_s.o
_uw_init_context_1 in unwind-dw2_s.o
__Unwind_GetGR in unwind-dw2_s.o
__Unwind_SetGR in unwind-dw2_s.o
__Unwind_Resume in unwind-dw2_s.o
__Unwind_Resume_or_Rethrow in unwind-dw2_s.o
_size_of_encoded_value in unwind-dw2-fde-darwin_s.o
_read_encoded_value_with_base in unwind-dw2-fde-darwin_s.o
_base_from_object.isra.3 in unwind-dw2-fde-darwin_s.o
_base_from_object.isra.3 in unwind-dw2-fde-darwin_s.o
_search_object in unwind-dw2-fde-darwin_s.o
___deregister_frame_info_bases in unwind-dw2-fde-darwin_s.o
_read_encoded_value_with_base in unwind-c_s.o
___gcc_personality_v0 in unwind-c_s.o
___gcc_personality_v0 in unwind-c_s.o
___gcc_personality_v0 in unwind-c_s.o
_emutls_init in emutls_s.o
___emutls_get_address in emutls_s.o
"_memset", referenced from:
_uw_frame_state_for in unwind-dw2_s.o
_uw_init_context_1 in unwind-dw2_s.o
___frame_state_for in unwind-dw2_s.o
___emutls_get_address in emutls_s.o
___emutls_get_address in emutls_s.o
"_strlen", referenced from:
_uw_frame_state_for in unwind-dw2_s.o
_get_cie_encoding in unwind-dw2-fde-darwin_s.o
"__keymgr_set_and_unlock_processwide_ptr", referenced from:
_live_image_destructor in unwind-dw2-fde-darwin_s.o
__Unwind_Find_FDE in unwind-dw2-fde-darwin_s.o
"_memcpy", referenced from:
_execute_cfa_program in unwind-dw2_s.o
_execute_cfa_program in unwind-dw2_s.o
_uw_install_context_1 in unwind-dw2_s.o
_uw_update_context_1 in unwind-dw2_s.o
__Unwind_RaiseException in unwind-dw2_s.o
__Unwind_RaiseException in unwind-dw2_s.o
__Unwind_ForcedUnwind in unwind-dw2_s.o
__Unwind_Resume in unwind-dw2_s.o
__Unwind_Resume_or_Rethrow in unwind-dw2_s.o
___emutls_get_address in emutls_s.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[5]: *** [libgcc_s.dylib] Error 1
make[4]: *** [multi-do] Error 1
make[3]: *** [all-multi] Error 2
make[2]: *** [all-stage1-target-libgcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2
sh-4.3#
Several years ago, there appeared to be a lead on how to rectify this issue, but that lead is now a dead end. Another lead, in Japanese, suggested preceding the configure/build steps by first running an “export ARCHFLAGS” — though in my case I tried both the suggestion, verbatim, as well as just running it with the last part (i.e., “-arch ppc” only):
export ARCHFLAGS='-arch i386 -arch x86_64 -arch ppc'
Has anyone here ever run across anything like this, and if so, have you managed to find any kind of workaround?
UPDATE: I should also add I’ve tried the following build flags suggested by the GNU configure page, and the outcome remains identical:
sh-4.3# ./configure --with-arch-32=powerpc --without-arch-64 --without-cpu-64
UPDATE THE SECOND: In what amounts to throwing stuff at a wall and seeing what sticks to it, I’ve been trying various configure flags which may or may not have an impact on the make process. I honestly don’t know what I’m doing, other than feeling like a naif. At present, this set of configure flags is yielding a different make error:
./configure --disable-multilib --with-cpu_32=powerpc --without-cpu_64 --enable-languages=c++,fortran,java,objc --program-transform-name=s,y,y, --disable-option-checking --with-target-subdir=powerpc-apple-darwin10 --build=powerpc-apple-darwin10 --host=powerpc-apple-darwin10 --target=powerpc-apple-darwin10 --disable-intermodule --disable-checking --disable-coverage
(As part of experimentation, I stripped away the “10.0.0d1” to make it simply “10”. For the most part, this seems to try building in a directory named “powerpc-apple-darwin10”.)
The current flavour of errors have all included an “error 77”, which departs from earlier:
checking for powerpc-apple-darwin10-gcc... /opt/gcc-4.6.4/host-powerpc-apple-darwin10/gcc/xgcc -B/opt/gcc-4.6.4/host-powerpc-apple-darwin10/gcc/ -B/usr/local/powerpc-apple-darwin10/bin/ -B/usr/local/powerpc-apple-darwin10/lib/ -isystem /usr/local/powerpc-apple-darwin10/include -isystem /usr/local/powerpc-apple-darwin10/sys-include
checking for C compiler default output file name...
configure: error: in `/opt/gcc-4.6.4/powerpc-apple-darwin10/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgomp] Error 77
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2
I’ll keep at it after some rest and when I have some time to return to it, but I’m not sure what to try next.
Last edited: