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
Stage1: Add Visibility field to ExportOptions. #9831
Merged
Merged
+45
−7
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vexu
reviewed
Sep 24, 2021
710161c
to
9200478
Compare
Vexu
approved these changes
Feb 14, 2022
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
* Rename std.builtin.GlobalVisibility to std.builtin.SymbolVisibility * Add missing compile error. From the LLVM language reference: "A symbol with internal or private linkage must have default visibility."
andrewrk
requested changes
May 10, 2022
$ valgrind ./zig test ../test/behavior.zig -target powerpc-linux-musl -lc -I../test
==2828778== Invalid read of size 1
==2828778== at 0x6EA0265: LLVMSetVisibility (in /home/andy/Downloads/zig/build/zig)
==2828778== by 0x1BCE60B: do_code_gen(CodeGen*) (codegen.cpp:9031)
==2828778== by 0x1BD51E2: codegen_build_object(CodeGen*) (codegen.cpp:10610)
==2828778== by 0x1BA5C17: zig_stage1_build_object (stage1.cpp:132)
==2828778== by 0xE61E24: Module.build_object (stage1.zig:149)
==2828778== by 0xC3D4CE: Compilation.updateStage1Module (Compilation.zig:5025)
==2828778== by 0xC3117E: Compilation.performAllTheWork (Compilation.zig:2691)
==2828778== by 0xC2A3ED: Compilation.update (Compilation.zig:2098)
==2828778== by 0xBB9D1F: main.updateModule (main.zig:3104)
==2828778== by 0xB16B75: main.buildOutputType (main.zig:2793)
==2828778== by 0xAD0526: main.mainArgs (main.zig:225)
==2828778== by 0xACFCB9: main (stage1.zig:48)
``` $ valgrind ./zig test ../test/behavior.zig -target powerpc-linux-musl -lc -I../test ==2828778== Invalid read of size 1 ==2828778== at 0x6EA0265: LLVMSetVisibility (in /home/andy/Downloads/zig/build/zig) ==2828778== by 0x1BCE60B: do_code_gen(CodeGen*) (codegen.cpp:9031) ==2828778== by 0x1BD51E2: codegen_build_object(CodeGen*) (codegen.cpp:10610) ==2828778== by 0x1BA5C17: zig_stage1_build_object (stage1.cpp:132) ==2828778== by 0xE61E24: Module.build_object (stage1.zig:149) ==2828778== by 0xC3D4CE: Compilation.updateStage1Module (Compilation.zig:5025) ==2828778== by 0xC3117E: Compilation.performAllTheWork (Compilation.zig:2691) ==2828778== by 0xC2A3ED: Compilation.update (Compilation.zig:2098) ==2828778== by 0xBB9D1F: main.updateModule (main.zig:3104) ==2828778== by 0xB16B75: main.buildOutputType (main.zig:2793) ==2828778== by 0xAD0526: main.mainArgs (main.zig:225) ==2828778== by 0xACFCB9: main (stage1.zig:48) ``` Since the plan is to ship stage3 for Zig 0.10.0, the stage1 implementation of this hardly matters.
|
@andrewrk thank you so much for taking this over... (completely forgot about it...)! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Part of #9762. This PR adds
Visibilityfield tobuiltin.ExportOptionsin order to allow users to control the visibility of exports.At least this is already verified to work in my local, and will do the follow up PRs after this is merged; 1) change the default visibility of compiler_rt and libc symbols, 2) add a flag for controlling the default visibility (just like
-fvisibilityflag in clang), and 3) support in stage 2.