Alright, I can confirm that this is 100% reproducible on a basic Debian 7 installation in an armhf VM
/usr/bin/ld: src/.build/board.o: relocation R_ARM_THM_MOVW_ABS_NC against `__stack_chk_guard' can not be used when making a shared object; recompile with -fPIC
src/.build/board.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libcore.so] Error 1
This, for the oddly curious, is the list of packages I had installed over the base install provided by the debian netinstall:
xserver-xorg
build-essential
libvorbis-dev
libogg-dev
libsdl12-dev
slim
icewm
xterm
sudo
links2
So its fairly safe to assume this would happen on pretty much any debian-armhf system.
So, trying a few workarounds that come to mind
First, I ran with make V=1 to see what flags were actually being used. I noticed -fstack-protector-all and remembered lancer saying something about it seeming to be related to the issue, so I tried removing lines 135-140 from the makefile.
This simply changed the symbol being relocated against:
/usr/bin/ld: src/.build/board.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
src/.build/board.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libcore.so] Error 1
Frankie ran against something similar when he tried the same, iirc.
I put the -fstack-protector-all back in as it seemed to not be the actual culprit anymore.
Then, I decided to take the compiler's advice and add -fPIC, sticking this below line 128 in the makefile.
ifeq (${SUBPLATFORM},linux-arm)
CFLAGS += -fPIC
CXXFLAGS += -fPIC
endif
This enabled the compile and link to complete without errors, producing a working, modular copy of Megazeux on Debian 7 ARMhf.
I don't know if it's needed on non hard-float ARM platforms (platform.inc/config.sh have no way of telling armhf "ARM with hardware floating point" from armel "normal ARM" at the moment), or if enabling -fPIC has any other reprecussions in MZX, so I'm hesitant to recommend this patch for general use, but it seems to work just fine so far.