Skip to content

Commit bf18752

Browse files
committed
Misc fixes while testting 32-bit
Don't add --disable-high-entropy-va on 32-bit, it's only supported on 64-bit For executables, add --large-address-aware for 32-bit, and --tsaware for all, to match gcc. Map -rdynamic to --export-all-symbols to match https://cygwin.com/cgit/cygwin-packages/gcc/tree/0004-Cygwin-add-dummy-pthread-tsaware-and-large-address-a.patch
1 parent 5a02673 commit bf18752

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/lib/Driver/ToolChains/Cygwin.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ void cygwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
207207
CmdArgs.push_back("-Bdynamic");
208208

209209
CmdArgs.push_back("--dll-search-prefix=cyg");
210+
if (Args.hasArg(options::OPT_rdynamic))
211+
CmdArgs.push_back("--export-all-symbols");
212+
if (!Args.hasArg(options::OPT_shared) && !Args.hasArg(options::OPT_mdll)) {
213+
if (ToolChain.getTriple().isArch32Bit())
214+
CmdArgs.push_back("--large-address-aware");
215+
CmdArgs.push_back("--tsaware");
216+
}
210217

211218
CmdArgs.push_back("-o");
212219
const char *OutputFile = Output.getFilename();
@@ -283,7 +290,7 @@ void cygwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
283290
StringRef(Arg) == "--disable-nxcompat")
284291
saw_nxcompat = true;
285292
}
286-
if (!saw_high_entropy_va)
293+
if (!saw_high_entropy_va && ToolChain.getTriple().isArch64Bit())
287294
CmdArgs.push_back("--disable-high-entropy-va");
288295
if (!saw_nxcompat)
289296
CmdArgs.push_back("--disable-nxcompat");

0 commit comments

Comments
 (0)