| author | |
| committer | |
| log | 0ccd2b0c5cdf4bee706b4a9341b97f786b19a978 |
| tree | 1c6b62ef1ea5794c8ca0d71d7f4f37680c683bc4 |
| parent | a81fb5fb76131d0df3042f20e2d20a3b9216b254 |
| signature |
Fuchsia only supports PIE executables, specifically ET_DYN.
https://fuchsia.dev/fuchsia-src/concepts/process/program_loading2 files changed, 6 insertions(+), 0 deletions(-)
src/Compilation/Config.zig+5| ... | @@ -135,6 +135,7 @@ pub const ResolveError = error{ | ... | @@ -135,6 +135,7 @@ pub const ResolveError = error{ |
| 135 | LibCppRequiresLibC, | 135 | LibCppRequiresLibC, |
| 136 | LibUnwindRequiresLibC, | 136 | LibUnwindRequiresLibC, |
| 137 | TargetCannotDynamicLink, | 137 | TargetCannotDynamicLink, |
| 138 | TargetCannotStaticLinkExecutables, | ||
| 138 | LibCRequiresDynamicLinking, | 139 | LibCRequiresDynamicLinking, |
| 139 | SharedLibrariesRequireDynamicLinking, | 140 | SharedLibrariesRequireDynamicLinking, |
| 140 | ExportMemoryAndDynamicIncompatible, | 141 | ExportMemoryAndDynamicIncompatible, |
| ... | @@ -360,6 +361,10 @@ pub fn resolve(options: Options) ResolveError!Config { | ... | @@ -360,6 +361,10 @@ pub fn resolve(options: Options) ResolveError!Config { |
| 360 | if (options.link_mode == .dynamic) return error.TargetCannotDynamicLink; | 361 | if (options.link_mode == .dynamic) return error.TargetCannotDynamicLink; |
| 361 | break :b .static; | 362 | break :b .static; |
| 362 | } | 363 | } |
| 364 | if (target.os.tag == .fuchsia and options.output_mode == .Exe) { | ||
| 365 | if (options.link_mode == .static) return error.TargetCannotStaticLinkExecutables; | ||
| 366 | break :b .dynamic; | ||
| 367 | } | ||
| 363 | if (explicitly_exe_or_dyn_lib and link_libc and | 368 | if (explicitly_exe_or_dyn_lib and link_libc and |
| 364 | (target_util.osRequiresLibC(target) or | 369 | (target_util.osRequiresLibC(target) or |
| 365 | // For these libcs, Zig can only provide dynamic libc when cross-compiling. | 370 | // For these libcs, Zig can only provide dynamic libc when cross-compiling. |
src/main.zig+1| ... | @@ -4118,6 +4118,7 @@ fn createModule( | ... | @@ -4118,6 +4118,7 @@ fn createModule( |
| 4118 | error.LibCppRequiresLibC => fatal("libc++ requires linking libc", .{}), | 4118 | error.LibCppRequiresLibC => fatal("libc++ requires linking libc", .{}), |
| 4119 | error.LibUnwindRequiresLibC => fatal("libunwind requires linking libc", .{}), | 4119 | error.LibUnwindRequiresLibC => fatal("libunwind requires linking libc", .{}), |
| 4120 | error.TargetCannotDynamicLink => fatal("dynamic linking unavailable on the specified target", .{}), | 4120 | error.TargetCannotDynamicLink => fatal("dynamic linking unavailable on the specified target", .{}), |
| 4121 | error.TargetCannotStaticLinkExecutables => fatal("static linking of executables unavailable on the specified target", .{}), | ||
| 4121 | error.LibCRequiresDynamicLinking => fatal("libc of the specified target requires dynamic linking", .{}), | 4122 | error.LibCRequiresDynamicLinking => fatal("libc of the specified target requires dynamic linking", .{}), |
| 4122 | error.SharedLibrariesRequireDynamicLinking => fatal("using shared libraries requires dynamic linking", .{}), | 4123 | error.SharedLibrariesRequireDynamicLinking => fatal("using shared libraries requires dynamic linking", .{}), |
| 4123 | error.ExportMemoryAndDynamicIncompatible => fatal("exporting memory is incompatible with dynamic linking", .{}), | 4124 | error.ExportMemoryAndDynamicIncompatible => fatal("exporting memory is incompatible with dynamic linking", .{}), |