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

[tools] Add 'ecc' ELKS C86 compiler driver script #2119

Merged
merged 1 commit into from
Nov 29, 2024
Merged

[tools] Add 'ecc' ELKS C86 compiler driver script #2119

merged 1 commit into from
Nov 29, 2024

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Nov 29, 2024

Adds easy-to-use ecc compiler driver for use with @rafael2k's 8086-toolchain which is being discussed in #2112 and requires the changes in rafael2k/8086-toolchain#5.

The initial primary purpose of this script is to allow for quick test preprocessing, compilation, assembly and link of a single .c file to test the C86 toolchain without having to write a Makefile.

For instance, with a complete foo.c program in 8086-toolchain, the files foo.i, foo.asm, foo.o and foo will be created by:

cd 8086-toolchain
ecc foo

The ecc script lives in ELKS $TOPDIR/elks/tools/bin/ecc. It must first be edited to contain the top directories of the ELKS and C86 installation before it will work. This is documented in the script itself.

Also, currently the script requires running in the 8086-toolchain directory. This is because it assembles the lib86.a library from source each time. This will be automated in the 8086-toolchain master make shortly.

@ghaerr ghaerr merged commit 0fbe1d2 into master Nov 29, 2024
1 check passed
@ghaerr ghaerr deleted the ecc branch November 29, 2024 03:10
@toncho11
Copy link
Contributor

This is is only for cross compile on the host OS?

@rafael2k
Copy link

While I did not test inside ELKS yet (will do it soon), it should work for both foreign and native.

@ghaerr
Copy link
Owner Author

ghaerr commented Nov 29, 2024

The plan is to write a C-based compiler driver that will run on both systems, but its a bit early in the game for that, as we haven't really settled down on a full toolchain flow and there are still lots of issues.

The current ecc script is overkill for ELKS and may introduce too much memory overhead, as it involves loading the shell into memory for execution, which is large. There's no header files and no C library available and not much that can be done yet on ELKS anyways. Nonetheless, if you want to try it, I would suggest just using the bottom half of the file, and adding the toolchain to /bin, since the script uses some constructs ASH doesn't support, like if [[ ....

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

Successfully merging this pull request may close these issues.

3 participants