[PATCH] D154396: [clang] Add support for SerenityOS

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 2 10:39:59 PDT 2023


MaskRay added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Serenity.cpp:31
+  Arg *Last = Args.getLastArg(options::OPT_pie, options::OPT_no_pie,
+                              options::OPT_nopie);
+  return Last ? Last->getOption().matches(options::OPT_pie) : true;
----------------
`-no-pie` is nowadays canonical and GCC does't support `-nopie`. You can drop `-nopie`.


================
Comment at: clang/lib/Driver/ToolChains/Serenity.cpp:76
+  if (!IsStatic || IsStaticPIE)
+    CmdArgs.push_back("--eh-frame-hdr");
+
----------------
This is not tested


================
Comment at: clang/lib/Driver/ToolChains/Serenity.cpp:85
+  CmdArgs.push_back("-z");
+  CmdArgs.push_back("pack-relative-relocs");
+
----------------
This is untested


================
Comment at: clang/lib/Driver/ToolChains/Serenity.cpp:211
+                          options::OPT_fno_use_init_array, true))
+    CC1Args.push_back("-fno-use-init-array");
+}
----------------
This is for systems that historically support .ctors/.dtors https://maskray.me/blog/2021-11-07-init-ctors-init-array

If Serenity doesn't, this should be removed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154396/new/

https://reviews.llvm.org/D154396



More information about the cfe-commits mailing list