Skip to content

Commit

Permalink
Fix objc link flag being added on non-darwin platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Nov 20, 2024
1 parent 4246d42 commit 2670dbb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion driver/linker-gcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,6 @@ void ArgsBuilder::addDefaultPlatformLibs() {
// fallthrough
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
this->addObjcStdlibLinkFlags(triple);
case llvm::Triple::FreeBSD:
case llvm::Triple::NetBSD:
case llvm::Triple::OpenBSD:
Expand All @@ -738,6 +737,13 @@ void ArgsBuilder::addDefaultPlatformLibs() {
break;
}

if (triple.isOSDarwin()) {

// libobjc is more or less required, so we link against it here.
// This could be prettier, though.
this->addObjcStdlibLinkFlags(triple);
}

if (triple.isWindowsGNUEnvironment()) {
// This is really more of a kludge, as linking in the Winsock functions
// should be handled by the pragma(lib, ...) in std.socket, but it
Expand Down

0 comments on commit 2670dbb

Please sign in to comment.