mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
musl-based linux distro support (#2577)
* added switch statement to link musl-based linux distros to ld-musl-x86-64.so.2
* Update linker.c
/lib/ld-musl-x86-64.so.1 is musl's ld so. My bad
* don't need ENV_MUSLEABI.* in the switch for x86_64
* typo
* Added a CI test for an Alpine Linux container
* Update main.yml
Forgot to have bundle_output job use `env.LLVM_RELEASE_VERSION_ALPINEv3_22`.
* Added env.LLVM_RELEASE_VERSION_ALPINEv3_22 to `upload artifacts`
* changed bundle name to c3-musl-${{matrix,build_type}}.tar.gz
* Undid an accidental name change in build-linux-ubuntu22
* Update main.yml
sudo doesn't exist in alpine by default, and runs in root by default.
* Update main.yml
* Update main.yml
* Update main.yml
* Update main.yml
`--linker=builtin` fails because it forces search of `/lib64/ld-linux-x86-64.so.2`. lib64 doesn't exist on musl unless created as a symlink, and the appropriate so is /lib/ld-musl-<arch>.so.1
* Update main.yml
* Update main.yml
* Update main.yml
* Update main.yml
make isn't in alpine by default. added it in for risc-v example.
* gcc-riscv-none-elf is alpine's package
* using realpath for c3c over using relative pathing
* Have to use relative path for arguments in compiler test
* added --linker=builtin to
* Added linux-musl-<arch> targets
* Added more ld targets for glibc
* set both testproject libs as folders until they behave better
* added linux-musl-x64 target to clib2
* added riscv targets for ld-linux
* ubuntu doesn't have ld in /lib, but solely in /lib64?
* Make MUSL distinct from the target.
* Fix default in project schema
* Fix define
* Fix manifests.
* Update main.yml
add --linux-libc flag for builtin linking
* Grammar refresh
* Update releasenotes.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
committed by
GitHub
parent
ce0ab62c78
commit
ccffa03de2
@@ -6,10 +6,12 @@ hello.a: $(SRCS_C3)
|
||||
$(C3C_PATH)c3c -g --use-stdlib=no --no-entry --target elf-riscv32 static-lib $(SRCS_C3)
|
||||
|
||||
start.o: start.s
|
||||
riscv64-unknown-elf-as -g -march=rv32i -mabi=ilp32 -misa-spec=20191213 -o start.o start.s
|
||||
riscv64-unknown-elf-as -g -march=rv32i -mabi=ilp32 -misa-spec=20191213 -o start.o start.s \
|
||||
|| riscv-none-elf-as -g -march=rv32i -mabi=ilp32 -misa-spec=20191213 -o start.o start.s
|
||||
|
||||
hello.elf: hello.a start.o baremetal.ld
|
||||
riscv64-unknown-elf-ld -T baremetal.ld -m elf32lriscv -o hello.elf hello.a start.o
|
||||
riscv64-unknown-elf-ld -T baremetal.ld -m elf32lriscv -o hello.elf hello.a start.o \
|
||||
|| riscv-none-elf-ld -T baremetal.ld -m elf32lriscv -o hello.elf hello.a start.o
|
||||
|
||||
run: hello.elf
|
||||
qemu-system-riscv32 -nographic -serial mon:stdio -machine virt -semihosting -bios hello.elf
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -199,6 +199,15 @@
|
||||
"description": "Include the standard library.",
|
||||
"default": true
|
||||
},
|
||||
"linux-libc": {
|
||||
"type": "string",
|
||||
"description": "Set the libc to use for Linux.",
|
||||
"enum": [
|
||||
"gnu",
|
||||
"musl"
|
||||
],
|
||||
"default": "gnu"
|
||||
},
|
||||
"x86cpu": {
|
||||
"type": "string",
|
||||
"description": "Set general level of x64 cpu.",
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
{
|
||||
"provides" : "clib",
|
||||
"c-sources" : ["hello2.c", "whitespace test.c"],
|
||||
"targets" : {
|
||||
"macos-x64" : {
|
||||
},
|
||||
"macos-aarch64" : {},
|
||||
"linux-x64" : {
|
||||
{
|
||||
"provides": "clib",
|
||||
"c-sources": [
|
||||
"hello2.c",
|
||||
"whitespace test.c"
|
||||
],
|
||||
"targets": {
|
||||
"macos-x64": {},
|
||||
"macos-aarch64": {},
|
||||
"linux-x64": {
|
||||
"cflags": "-fPIE"
|
||||
},
|
||||
"windows-x64" : {
|
||||
"c-include-dirs": ["C:\\"]
|
||||
"windows-x64": {
|
||||
"c-include-dirs": [
|
||||
"C:\\"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
BIN
resources/testproject/lib/clib2.c3l/__MACOSX/._manifest.json
Normal file
BIN
resources/testproject/lib/clib2.c3l/__MACOSX/._manifest.json
Normal file
Binary file not shown.
3
resources/testproject/lib/clib2.c3l/clib2.c3i
Normal file
3
resources/testproject/lib/clib2.c3l/clib2.c3i
Normal file
@@ -0,0 +1,3 @@
|
||||
module clib2;
|
||||
|
||||
extern fn void hello_from_c_zip();
|
||||
5
resources/testproject/lib/clib2.c3l/hello.c
Normal file
5
resources/testproject/lib/clib2.c3l/hello.c
Normal file
@@ -0,0 +1,5 @@
|
||||
#include <stdio.h>
|
||||
void hello_from_c_zip(void)
|
||||
{
|
||||
puts("Hello from C Zip!");
|
||||
}
|
||||
14
resources/testproject/lib/clib2.c3l/manifest.json
Normal file
14
resources/testproject/lib/clib2.c3l/manifest.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"provides": "clib2",
|
||||
"c-sources": [
|
||||
"hello.c"
|
||||
],
|
||||
"targets": {
|
||||
"macos-x64": {},
|
||||
"macos-aarch64": {},
|
||||
"linux-x64": {
|
||||
"cflags-override": "-fPIE"
|
||||
},
|
||||
"windows-x64": {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user