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

Avoid Clang integrated assembler on macOS PowerPC #769

Merged
merged 1 commit into from
Dec 30, 2018
Merged

Avoid Clang integrated assembler on macOS PowerPC #769

merged 1 commit into from
Dec 30, 2018

Conversation

tanzislam
Copy link
Contributor

@tanzislam tanzislam commented Dec 30, 2018

On my iBook G3 Indigo (PowerPC 750CXe) running OSX Tiger 10.4.11, XCode 2.5, MacPorts 2.5.4, and sudo port -v install git gcc7 gmake wget bash, trying to build Crypto++ resulted in this error:

$ export CXX=/opt/local/bin/g++-mp-7
$ gmake deps
Using testing flags: -Wa,-q
g++ -Wa,-q -DCRYPTOPP_DISABLE_ALTIVEC -fPIC -pipe -DCRYPTOPP_DISABLE_ASM -MM *.cpp > GNUmakefile.deps
$ gmake
Using testing flags: -Wa,-q
g++ -Wa,-q -DCRYPTOPP_DISABLE_ALTIVEC -fPIC -pipe -c cryptlib.cpp
/opt/local/bin/as: can't specifiy -q with -arch ppc
gmake: *** [GNUmakefile:1573: cryptlib.o] Error 2
gmake: Target 'default' not remade because of errors.

The Clang integrated assembler seems to be used for targeting modern Intel instruction sets, because the default GCC Assembler (v1.38) is too old. Change that logic to not be activated on PowerPC systems.

For reference, on my system:

$ /opt/local/bin/as -v < /dev/null
Apple Inc version cctools-921, GNU assembler version 1.38
$ /opt/local/bin/as -qv < /dev/null
/opt/local/bin/as: can't specifiy -q with -arch ppc

and:

$ /usr/bin/as -v < /dev/null
Apple Computer, Inc. version cctools-622.9~2, GNU assembler version 1.38
$ /usr/bin/as -qv < /dev/null
/usr/bin/../libexec/gcc/darwin/ppc/as: I don't understand 'q' flag!
Apple Computer, Inc. version cctools-622.9~2, GNU assembler version 1.38

On my iBook G3 Indigo (PowerPC 750CXe) running OSX Tiger 10.4.11, XCode 2.5, MacPorts 2.5.4, and `sudo port -v install git gcc7 gmake wget bash`, trying to build Crypto++ resulted in this error:

```
$ export CXX=/opt/local/bin/g++-mp-7
$ gmake deps
Using testing flags: -Wa,-q
g++ -Wa,-q -DCRYPTOPP_DISABLE_ALTIVEC -fPIC -pipe -DCRYPTOPP_DISABLE_ASM -MM *.cpp > GNUmakefile.deps
$ gmake
Using testing flags: -Wa,-q
g++ -Wa,-q -DCRYPTOPP_DISABLE_ALTIVEC -fPIC -pipe -c cryptlib.cpp
/opt/local/bin/as: can't specifiy -q with -arch ppc
gmake: *** [GNUmakefile:1573: cryptlib.o] Error 2
gmake: Target 'default' not remade because of errors.
```

The Clang integrated assembler seems to be used for targeting modern Intel instruction sets, because the default GCC Assembler (v1.38) is too old. Change that logic to not be activated on PowerPC systems.

For reference, on my system:

```
$ /opt/local/bin/as -v < /dev/null
Apple Inc version cctools-921, GNU assembler version 1.38
$ /opt/local/bin/as -qv < /dev/null
/opt/local/bin/as: can't specifiy -q with -arch ppc
```

and:

```
$ /usr/bin/as -v < /dev/null
Apple Computer, Inc. version cctools-622.9~2, GNU assembler version 1.38
$ /usr/bin/as -qv < /dev/null
/usr/bin/../libexec/gcc/darwin/ppc/as: I don't understand 'q' flag!
Apple Computer, Inc. version cctools-622.9~2, GNU assembler version 1.38
```
@noloader noloader merged commit 148a5e9 into weidai11:master Dec 30, 2018
@noloader
Copy link
Collaborator

Thank you very much.

Sorry about missing that. My PowerMac is down at the moment.

@noloader noloader changed the title Avoid Clang integrated assembler on macOS PowerPC (MacPorts) GCC Avoid Clang integrated assembler on macOS PowerPC Dec 30, 2018
@tanzislam tanzislam deleted the avoid-clang-integrated-assembler-on-macports-powerpc branch December 30, 2018 06:04
@noloader
Copy link
Collaborator

noloader commented Jan 1, 2019

OK, my PowerMac is back up. I'm testing OK with the patch applied. Thanks again.

I'm wondering if we should add a feature test for it, like Clang and test_mixed_asm.cxx.

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

Successfully merging this pull request may close these issues.

None yet

2 participants