Trouble compiling with gcc 4.8 on 10.5 PowerPC

Andreas Falkenhahn andreas at falkenhahn.com
Sat Mar 17 22:17:38 UTC 2018


Hi,

I need to compile C++11 sources for PowerPC OS X so I installed gcc48 using Mac Ports. Although the binary generated by gcc-mp-4.8 actually works, I do get some warning messages which are worrying me.

When linking my project, I get this warning:

    ld: warning: 32-bit absolute address out of range (0x100521C58 max is 4GB): from _REQUIRED_TAGS + 0x00000034 (0x00521C5C) to 0x100521C58

For reference, this is how I link my project:

    gcc-mp-4.8 -fPIC -dynamiclib -exported_symbols_list exports.def -o macppc48/plugin.dylib macppc48/plugin.o -Llibharu/macppc48 -Llibapng/macppc48 -Lpdfium/macppc48 -L../freetype-2.8/macppc48/objs/.libs -lharu -lapng -lpdfjpeg -lfreetype -lcms -lopenjpeg -lagg -lpdfium -lfdrm -lfpdfdoc -lfpdfapi -lfpdftext -lfxcodec -lopenjpeg -lfxcrt -lfxge -lpwl -lformfiller -ljavascript -lpdfiumbase -lfdrm -lfreetype -lpdfjpeg -lagg -lcms -lm -lpwl -lfpdfdoc -lz -lstdc++ -framework AppKit -framework CoreFoundation

When running my project, I get lots of these errors:

    testprogram(151,0xa0b96820) malloc: *** error for object 0x41384d0: Non-aligned pointer being freed (2)
    *** set a breakpoint in malloc_error_break to debug

My project is a cross-platform project which already runs fine on many other platforms (x86/x64 Mac; Windows; x86/x64/ppc/arm Linux, etc.) so I'm pretty certain that those issues are not related to bugs in my code but that either something is wrong with gcc 4.8 or that I'm not using it correctly.

Anyone here who knows how to solve these issues? As I said, despite those warnings the program seems to work correctly but of course these warnings are worrying me and I want them to disappear.

Thanks!

-- 
Best regards,
 Andreas Falkenhahn                          mailto:andreas at falkenhahn.com



More information about the macports-users mailing list