--- qjsc.c	2025-03-31 19:37:37.000000000 +0800
+++ qjsc.c	2025-04-01 09:58:55.000000000 +0800
@@ -435,13 +435,11 @@
     /* XXX: use the executable path to find the includes files and
        libraries */
     *arg++ = "-D";
-    *arg++ = "_GNU_SOURCE";
+    *arg++ = "_DARWIN_C_SOURCE";
     *arg++ = "-I";
     *arg++ = inc_dir;
     *arg++ = "-o";
     *arg++ = out_filename;
-    if (dynamic_export)
-        *arg++ = "-rdynamic";
     *arg++ = cfilename;
     snprintf(libjsname, sizeof(libjsname), "%s/libquickjs%s%s.a",
              lib_dir, bn_suffix, lto_suffix);
@@ -449,6 +447,8 @@
     *arg++ = "-lm";
     *arg++ = "-ldl";
     *arg++ = "-lpthread";
+    *arg++ = "-latomic";
+    *arg++ = "-lMacportsLegacySupport";
     *arg = NULL;
 
     if (verbose) {
