-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[libc] Add Scrt1.o
to startup_components
#97497
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
base: main
Are you sure you want to change the base?
Conversation
Needs for `-fpie` targets. Don't know if this is safe or not... but it seems to run compiled executables.
@llvm/pr-subscribers-libc Author: Izaak Schroeder (izaakschroeder) ChangesNeeds for Full diff: https://github.com/llvm/llvm-project/pull/97497.diff 1 Files Affected:
diff --git a/libc/startup/linux/CMakeLists.txt b/libc/startup/linux/CMakeLists.txt
index 336c5d0f6bfa2..b721d15091227 100644
--- a/libc/startup/linux/CMakeLists.txt
+++ b/libc/startup/linux/CMakeLists.txt
@@ -118,6 +118,15 @@ merge_relocatable_object(
.do_start
)
+# HACK: Is this even ok?
+# For reference: `Scrt1` is used when `-fpie` vs `crt1` for `-fno-pie`
+merge_relocatable_object(
+ Scrt1
+ .${LIBC_TARGET_ARCHITECTURE}.start
+ .${LIBC_TARGET_ARCHITECTURE}.tls
+ .do_start
+)
+
add_startup_object(
crti
SRC
@@ -131,7 +140,7 @@ add_startup_object(
)
add_custom_target(libc-startup)
-set(startup_components crt1 crti crtn)
+set(startup_components Scrt1 crt1 crti crtn)
foreach(target IN LISTS startup_components)
set(fq_target_name libc.startup.linux.${target})
add_dependencies(libc-startup ${fq_target_name})
|
cc @MaskRay . I am not sure directly creating |
@SchrodingerZhu @MaskRay is there a simple path forward I can take, even if temporarily, to keep the ball moving? Like adding a |
I am not familiar with the build system, but you can create |
Do you know where the differences between these files is documented? |
They are undocumented. One needs to investigate whether other libc implementations do... |
Good to know my failing to find anything online wasn't a skill issue, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing a "minus one" on this for now until we better understand if/why this is necessary.
Needed for
-fpie
targets. Don't know if this is safe or not... but it seems to run compiled C++ executables.