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

Only add symbols that are explicit entrypoints when building juliac image #56681

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

gbaraldi
Copy link
Member

This currently just does a linear search over the items. We might want to change this datastructure to a hash table at some point, but given that I don't think libraries have too too many entrypoints this linear search should be fast enough.

src/precompile_utils.c Outdated Show resolved Hide resolved
src/staticdata.c Outdated Show resolved Hide resolved
@topolarity topolarity linked an issue Dec 6, 2024 that may be closed by this pull request
Copy link
Member

@topolarity topolarity left a comment

Choose a reason for hiding this comment

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

Looking good! I like this version much better

Thanks @gbaraldi 👍

src/staticdata.c Outdated Show resolved Hide resolved
@topolarity
Copy link
Member

Is it possible to add #56603 as a test?

@topolarity topolarity added the merge me PR is reviewed. Merge when all tests are passing label Jan 22, 2025
@inkydragon
Copy link
Member

Test failed seems related.

gcc -march=native -mtune=native -m64 -c -o init.o /cache/build/tester-amdci4-8/julialang/julia-master/test/trimming/init.c   -std=gnu11 -I'/cache/build/tester-amdci4-8/julialang/julia-master/usr/include/julia' -fPIC
make: Leaving directory '/cache/build/tester-amdci4-8/julialang/julia-master/test/trimming'
make: Entering directory '/cache/build/tester-amdci4-8/julialang/julia-master/test/trimming'
/cache/build/tester-amdci4-8/julialang/julia-master/usr/bin/julia -t 1 -J /cache/build/tester-amdci4-8/julialang/julia-master/usr/bin/../lib/julia/sys.so --startup-file=no --history-file=no --output-o hello.o --output-incremental=no --strip-ir --strip-metadata --experimental --trim /cache/build/tester-amdci4-8/julialang/julia-master/usr/bin/../share/julia/juliac-buildscript.jl /cache/build/tester-amdci4-8/julialang/julia-master/test/trimming/hello.jl --output-exe true
warning: no code provided for function main() from main()
[171] signal 6 (-6): Aborted
in expression starting at none:0
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)

https://buildkite.com/julialang/julia-master/builds/43995#0194929f-3352-4899-a516-022a0ca44b27/790-809

@JeffBezanson JeffBezanson removed the merge me PR is reviewed. Merge when all tests are passing label Jan 24, 2025
@JeffBezanson
Copy link
Member

I pushed a version that should work. However there still seems to be a bug with const_return ccallables; including foo as an entrypoint in this test crashes.

This is only needed because `jl_reinit_ccallable` looks at method
metadata that trimming will normally remove for const_api code.
@JeffBezanson
Copy link
Member

OK I fixed that and added a test. But, we could ignore this whole situation entirely by skipping jl_reinit_ccallable for trimmed binaries. If you deploy without libjulia-codegen, it won't do anything anyway!

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.

Segfault with @ccallable functions and juliac
5 participants