OpenOrbis / mira-project-archive

The Homebrew Platform
GNU General Public License v3.0
221 stars 50 forks source link

Compilation error - undefined reference to `__stack_chk_fail' #50

Closed TwoLeaves closed 6 years ago

TwoLeaves commented 6 years ago

I get the following when trying to compile Mira on an up-to-date Archlinux system. Any ideas?

pepetheprawn% ./init_development_environment.sh 
Please choose a firmware:
\t[0] 5.01 Firmware
\t[1] 5.05 Firmware
Option? 1
-----------------------------------------------
Installing Mira with firmware '5.05' selected...
-----------------------------------------------
Creating directories...
Cleaning project...
Compiling src/oni/utils/utils.s ...
Compiling src/oni/utils/memory/syscall.s ...
Compiling src/oni/messaging/messagecategory.c ...
Compiling src/oni/messaging/message.c ...
Compiling src/oni/messaging/messagemanager.c ...
Compiling src/oni/rpc/rpcconnection.c ...
Compiling src/oni/rpc/rpcserver.c ...
Compiling src/oni/utils/dynlib.c ...
Compiling src/oni/utils/kdlsym.c ...
Compiling src/oni/utils/log/logger.c ...
Compiling src/oni/utils/sys_wrappers.c ...
Compiling src/oni/utils/lock.c ...
Compiling src/oni/utils/memory/install.c ...
Compiling src/oni/utils/memory/allocator.c ...
Compiling src/oni/plugins/pluginmanager.c ...
Compiling OniFramework...
Creating directories...
Cleaning project...
Compiling src/crt0.s ...
Compiling src/entrypoint.c ...
Compiling src/mira/boot/patches/patches505.c ...
Compiling src/mira/boot/patches/patches501.c ...
Compiling src/mira/boot/patches.c ...
Compiling src/mira/utils/hook.c ...
Compiling src/mira/utils/hde/hde64.c ...
Compiling src/mira/plugins/filetransfer/filetransfer_plugin.c ...
Compiling src/mira/plugins/logserver/logserver_plugin.c ...
Compiling src/mira/plugins/pluginloader.c ...
Compiling src/mira/plugins/debugger/debugger_plugin.c ...
Compiling MiraFW...
/usr/bin/ld: build/src/entrypoint.o: in function `mira_entry':
entrypoint.c:(.text+0xd8): undefined reference to `__stack_chk_fail'
/usr/bin/ld: build/src/mira/utils/hook.o: in function `hook_create':
hook.c:(.text+0x102): undefined reference to `__stack_chk_fail'
/usr/bin/ld: build/src/mira/utils/hook.o: in function `hook_enable':
hook.c:(.text+0x1b8): undefined reference to `__stack_chk_fail'
/usr/bin/ld: build/src/mira/plugins/filetransfer/filetransfer_plugin.o: in function `filetransfer_stat_callback':
filetransfer_plugin.c:(.text+0x2d9): undefined reference to `__stack_chk_fail'
/usr/bin/ld: build/src/mira/plugins/filetransfer/filetransfer_plugin.o: in function `filetransfer_read_callback':
filetransfer_plugin.c:(.text+0x6d3): undefined reference to `__stack_chk_fail'
/usr/bin/ld: build/src/mira/plugins/filetransfer/filetransfer_plugin.o:filetransfer_plugin.c:(.text+0x9c2): more undefined references to `__stack_chk_fail' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:82: MiraFW_Orbis.elf] Error 1
-----------------------------------------------
Done!
TwoLeaves commented 6 years ago

Fixed by adding "-fno-stack-protector" to the C++ flags of the MiraFW and oni-framework Makefiles.