Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong handling of -m32/-m64 [patch attached]. #824

Closed
markus-oberhumer-forks opened this issue Jan 13, 2015 · 1 comment
Closed

Wrong handling of -m32/-m64 [patch attached]. #824

markus-oberhumer-forks opened this issue Jan 13, 2015 · 1 comment

Comments

@markus-oberhumer-forks
Copy link

Hi,

first many thanks for your work on ldc - both LLVM and D are just great!

I'm completely new to ldc, but I needed the following patch against
ldc-0.15.1-src.tar.gz to make -m32/-m64 actually work.

cheers,
markus

Index: b/driver/ldmd.cpp
===================================================================
--- a/driver/ldmd.cpp
+++ b/driver/ldmd.cpp
@@ -945,7 +945,7 @@
     else if (p.debugInfo == Debug::pretendC) r.push_back("-gc");
     if (p.alwaysStackFrame) r.push_back("-disable-fp-elim");
     if (p.targetModel == Model::m32) r.push_back("-m32");
-    else if (p.targetModel == Model::m32) r.push_back("-m64");
+    else if (p.targetModel == Model::m64) r.push_back("-m64");
     if (p.profile) warning("CPU profile generation not yet supported by LDC.");
     if (p.verbose) r.push_back("-v");
     if (p.logTlsUse) warning("-vtls not yet supported by LDC.");
Index: b/driver/main.cpp
===================================================================
--- a/driver/main.cpp
+++ b/driver/main.cpp
@@ -992,6 +992,7 @@
         {
             error(Loc(), "cannot use both -m32 and -m64 options");
         }
+        bitness = ExplicitBitness::M64;
     }

     if (global.errors)
dnadlinger added a commit that referenced this issue Jan 13, 2015
@dnadlinger
Copy link
Member

Hi! Thanks a lot for the patch; I fixed the issue on master.

It really astonishes me how many bugs I managed to let slip into the LDMD code back in 2012 – must be the best example that late night coding isn't worth it in the long run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants