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

Cannot compile hello world #2

Open
antoyo opened this issue Sep 4, 2019 · 2 comments
Open

Cannot compile hello world #2

antoyo opened this issue Sep 4, 2019 · 2 comments

Comments

@antoyo
Copy link

antoyo commented Sep 4, 2019

Hi.
I tried to compile a hello world example:

// Hello world!
extern fn print(str *u8)

fn main()
  print("Hello world!")

with congo and it fails with the following error:

Compile finished in 0.00372612 sec (84 kb). 0 warnings detected
/usr/sbin/ld: release/main.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/sbin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status

Trying manually with gcc gives me the same result.

I'm on ArchLinux.
Thanks for your help.

@antoyo
Copy link
Author

antoyo commented Sep 4, 2019

I can compile manually with gcc when I provide the -no-pie flag.
I'm not sure if this is the solution in your case, but that might explain something.

@jondgoodwin
Copy link
Owner

Thanks for trying out Cone. Evidently, the ArchLinux default for gcc is to compile executables as position independent. I have a PIC option on the Cone compiler, but I don't think it is currently hooked up (something I need to correct). I'm glad you found a work-around for now.

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