aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 1085e2d779..2ebc1b830d 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -478,8 +478,12 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
{
break :dl true;
}
- if (options.system_libs.len != 0)
- break :dl true;
+ if (options.system_libs.len != 0) {
+ // when creating a executable that links to system libraries,
+ // we require dynamic linking, but we must not link static libraries
+ // or object files dynamically!
+ break :dl (options.output_mode == .Exe);
+ }
break :dl false;
};