Comments (4)
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.
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.
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.
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)
- Compiler reporting of time is sometimes obviously overestimated HOT 2
- Anonymous function output passed to print HOT 1
- Array declaration fails in global scope HOT 1
- Can't access global variable, as if not seen, but in fact it is seen HOT 2
- Doc for `extern` misses (curly braces) xor (colons) HOT 1
- Fails to print u32 HOT 4
- `typedef` fails HOT 6
- Add support for typed array size HOT 1
- Automatic cast of index when using each HOT 1
- Multidim array type compiles but not usable HOT 2
- Problem with multiple return values HOT 4
- Global arrays are not accessible if not initialized HOT 1
- Literals with underscores not recognized by print and returns HOT 3
- + operator called as a method in backticks does not work or is not implemented HOT 1
- Adding elements to a collection with <- doesn't work HOT 1
- Gist creation broken on the playground
- Grammar railroad diagram HOT 5
- SSL certificate on website invalid since Mar 15, 2022 HOT 2
- Unaccounted for line counting when tokenizing strings HOT 1
- Using C from Cone: calling fopen() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cone.