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

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 7 22:08:41 PST 2023


MaskRay added inline comments.


================
Comment at: clang/test/Driver/serenity.cpp:20
+// SERENITY_X86_64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld"
+// SERENITY_X86_64: "-pie"
+// SERENITY_X86_64: "-dynamic-linker" "/usr/lib/Loader.so" "--eh-frame-hdr"
----------------
Prefer `-SAME:` whenever applicable

ditto below


================
Comment at: clang/test/Driver/serenity.cpp:159
+// DEFAULT_LIBCXX: "-z" "pack-relative-relocs"
+// DEFAULT_LIBCXX: "crt0.o" "crti.o" "crtbeginS.o"
+// DEFAULT_LIBCXX: "--push-state"
----------------
`TC.GetFilePath("crti.o")` returns a path to `crti.o` if `crti.o` is found, otherwise a raw `crti.o` without a patch component. The raw `crti.o` indicates that clang driver fails to find `crti.o` in a search path.

I think you need to change `--sysroot=` to pointer to a directory tree in `Inputs/` where `crti.o` can be found.


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