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

Remove -m32/-m64 args from makefiles. #346

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

waywardmonkeys
Copy link
Contributor

We detect machinetype and build for the native CPU type as it
is, so we don't need to repeat this here in each makefile.

We detect machinetype and build for the native CPU type as it
is, so we don't need to repeat this here in each makefile.
@waywardmonkeys
Copy link
Contributor Author

I'm adding .mk files that we can include, one for each compiler, so that I can configure things like dependency flags correctly for each compiler.

That would be easier if there weren't 32 / 64 bit flags being given, especially as I don't think they should be needed.

Copy link
Collaborator

@nbriggs nbriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, I agree with this. I have a problem, though, in what ends up actually happening -- on my 10.11 (El Capitan) mac, the compiler default is 64-bit but it supports 32-bit as well and we have bin/machinetype reporting "386" rather than x86_64. On the SPARC Solaris system, bin/machinetype reports "sparc" (not sparc64, or sparcv9), and 3 different C compilers with 7 different versions -- some of them default to 32-bit (sparcv8 instruction set), some default to 64-bit (sparcv9 instruction set).

I'd like to be able to more easily pick the compiler and options that get used. It would also be great to have a consistent method to add extra (or change existing) options -- adding -Wxxx or -fxxx, change the -On and so on.

@masinter
Copy link
Member

on my mac mini I can do

arch -x86_64 ./makeright x

and compile maiko x86 binaries into darwin.x86_64/lde and ldex

@nbriggs
Copy link
Collaborator

nbriggs commented Feb 11, 2021

Yes, I can do arch -x86_64 ./makeright x on my MacBook Pro, but if I do arch -i386 ./makeright x it produces

arch: posix_spawnp: ./makeright: Bad CPU type in executable

because all the executables used to create a 32-bit lde are in fact 64-bit executables, and for most other systems it's more like the -m32/-m64 (or --target=<target-triple> for cross-compiling).

@waywardmonkeys
Copy link
Contributor Author

On macOS, it is usually -arch i386 and -arch x86_64 and -arch arm64 ... I'm still thinking about what to do about this patch.

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