Commit dce74c31cc

Felix (xq) Queißner <git@mq32.de>
2020-09-30 22:30:35
Depending on system libs only enforces libraries to require dynamic linking, but neither static libs nor object files.
1 parent 33bc1eb
Changed files (1)
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;
         };