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

Make repo a flake and make ld-linux be dynamically located #152

Merged
merged 6 commits into from
Dec 12, 2023

Conversation

Kaisia-Estrel
Copy link
Contributor

note that the executable is built with RelWithDebInfo instead of Release. That's because Release seems to cause a segfault. I haven't found out why it occurs, I but I've found it happens in Transformer::visitGlobal

Copy link
Member

@mauro-balades mauro-balades left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you so much! Really nice work. Some small changes though

mkdir -p bin/Release

#HACK: uses RelWithDebInfo since normal realease causes a segfault
cmake \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shound't we cann the release script here?

fs::path ld_linux_path;

void* handle = dlopen("ld-linux-x86-64.so.2", RTLD_LAZY);
if (!handle) { DEBUG_CODEGEN("Error getting library path: %s", dlerror()); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is really cool! Instead of DEBUG_CODEGEN we should raise an error instead, I can do that once I arrive at home since DEBUG_CODEGEN does not exist in release builds

flake.nix Show resolved Hide resolved
@mauro-balades mauro-balades added enhancement New feature or request good first issue Good for newcomers labels Dec 12, 2023
@mauro-balades mauro-balades merged commit a93550e into snowball-lang:dev Dec 12, 2023
1 of 5 checks passed
@mauro-balades
Copy link
Member

sorry, there are bugs, if you want, you can open a new PR with the same commits.

ld: cannot find /lib64/crt1.o: No such file or directory
ld: cannot find /lib64/crti.o: No such file or directory
ld: cannot find /lib64/crtn.o: No such file or directory
[error]: (Linker Error) Linking with ld failed with code 256

I pinged u on discord to discuss about this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants