Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to... #38

Closed
krionical opened this issue Oct 18, 2019 · 13 comments
Closed

undefined reference to... #38

krionical opened this issue Oct 18, 2019 · 13 comments

Comments

@krionical
Copy link

First of all, neat project. Second of all, I get the following list of errors:

ld: common.o: in function sprintf_va': common.c:(.text+0x836): undefined reference to __stack_chk_fail_local'
ld: common.o: in function sprintf': common.c:(.text+0x89b): undefined reference to __stack_chk_fail_local'
ld: common.o: in function printkf': common.c:(.text+0x96e): undefined reference to __stack_chk_fail_local'
ld: common.o: in function getCpuFlags': common.c:(.text+0xa4d): undefined reference to __stack_chk_fail_local'
ld: fatfilesystem.o: in function initializeFatFileSystem': fatfilesystem.c:(.text+0x96): undefined reference to __stack_chk_fail_local'
ld: fatfilesystem.o:fatfilesystem.c:(.text+0x2ef): more undefined references to __stack_chk_fail_local' follow ld: kernel.bin: hidden symbol __stack_chk_fail_local' isn't defined
ld: final link failed: bad value
make: *** [Makefile:10: kernel.bin] Error 1

In response to running the command: sudo ./gen_soso_iso init.soso examples/ex6.subx

Operating system is arch derivative.

@akkartik
Copy link
Owner

Thank you for the report. Let me try to spin up an Arch VM and see what's going on.

Could you try the other steps further down? You can run Mu without an OS so it emits ELF binaries you can run directly atop Linux. I'm curious if those commands all work.

@krionical
Copy link
Author

krionical commented Oct 18, 2019 via email

@akkartik
Copy link
Owner

I'm trying to reproduce. So far I have an Arch instance that passes ./test_apps.

Now I tried ./gen_soso_iso init.soso examples/ex6.subx and got this:

losetup: cannot find an unused loop device: No such device

Do you happen to know what package I need to pacman -S to install losetup?

@akkartik
Copy link
Owner

It looks like I may need to compile Soso with -fno-stack-protector somehow:

https://ubuntuforums.org/showthread.php?t=352642&s=b2839b58b613292d57ef7550af87ebca&p=10100263#post10100263

That's the initial hypothesis.

@krionical
Copy link
Author

krionical commented Oct 19, 2019 via email

@akkartik
Copy link
Owner

akkartik commented Oct 19, 2019

Ok, I've reproduced the issue after installing the following packages on Arch Linux:

# pacman -S git gcc make nasm util-linux dosfstools

Now trying to fix the error.

@akkartik
Copy link
Owner

Try it now? I've also updated the Readme with some extra dependencies that Arch Linux needed.

@krionical
Copy link
Author

krionical commented Oct 19, 2019 via email

@akkartik
Copy link
Owner

akkartik commented Oct 19, 2019 via email

@krionical
Copy link
Author

krionical commented Oct 19, 2019 via email

@akkartik
Copy link
Owner

Ohh, stupid mistake on my part. You need to make clean. These commands should do it:

cd kernel.soso
make clean
cd ..

Then try rerunning gen_soso_iso?

Sorry about the trouble!

@krionical
Copy link
Author

krionical commented Oct 19, 2019 via email

@akkartik
Copy link
Owner

Thank you for putting up with this klunky experience! Clearly the bootable images aren't yet mature. But the ELF binary generation should be much more painless. I ended up emphasizing that more in the Readme, based on this thread. So thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants