Git Product home page Git Product logo

Comments (4)

jondgoodwin avatar jondgoodwin commented on May 28, 2024

Congratulations on the successful install.

Sorry for the backward-incompatibility due to recent improvements to module handling.

The reason it fails is because imports no longer automatically fold names into the current module's namespace. You have to ask for it:

import stdio::*

Or you should also be able to do: stdio::print <- "Hello world!"

I hope this helps and fixes it for you.

from cone.

Ivo-Balbaert avatar Ivo-Balbaert commented on May 28, 2024

Thanks Jonathan, that worked. I was able to compile hello_world.cone with:

$ conec hello_world.cone
Compile finished in 0.124956 sec (274 kb). 0 warnings detected

And a hello_world.o was produced.
I also did: gcc -c ./src/conestd/stdio.c // compile the standard library into stdio.o

and then tried to link everything into an executable with:

gcc stdio.o hello_world.o -o hello

This however produced the error:

/usr/bin/ld: hello_world.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status

Recompiling with -fPIE didn't do the trick:
gcc stdio.o hello_world.o -o hello -fPIE

$ gcc stdio.o hello_world.o -o hello -fPIE
/usr/bin/ld: hello_world.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE

I tried some other things, but couldn't get past this error unfortunately. But perhaps I'm doing it the wrong way?

from cone.

jondgoodwin avatar jondgoodwin commented on May 28, 2024

So glad that helped.

On your new issue, I wonder if this suggestion would help: https://stackoverflow.com/questions/46827433/g-compile-error-rodata-can-not-be-used-when-making-a-shared-object-recomp

In effect: use the -no-pie option on gcc to create a position-dependent executable.

Another thing one might need to be careful about is whether Cone and gcc separate compilation agree on 64-bit vs 32-bit code.

By the way: It is still my plan to upgrade LLVM version before end-of-year.

from cone.

Ivo-Balbaert avatar Ivo-Balbaert commented on May 28, 2024

Awesome! -no-pie did the trick:

$ gcc stdio.o hello_world.o -no-pie -o hello

produced a hello executable that worked.

(I previously tried gcc stdio.o hello_world.o --no-pie -o hello because I found that somewhere else, but that gave the same error :-( )

I'm very glad Cone is coming out of hibernation and which you the very best with the LLVM upgrade! Meanwhile I'll experiment some more and read your delicious blog . I'm always available for testing things on Windows or Ubuntu (WSL2).

from cone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.