Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Fail to fetch version string of assembler when using integrated assembler #24199

Open Quuxplusone opened 9 years ago

Quuxplusone commented 9 years ago
Bugzilla Link PR24200
Status NEW
Importance P normal
Reported by Jeffrey Walton (noloader@gmail.com)
Reported on 2015-07-21 13:56:48 -0700
Last modified on 2020-01-10 10:32:02 -0800
Version 3.6
Hardware PC All
CC llvm-bugs@lists.llvm.org, rafael@espindo.la, yuanfang.chen@sony.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

We have a GNU makefile that mostly configures itself on the fly. The makefile has tests like:

GAS219_OR_LATER := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -i -c "GNU assembler version (2.19|2.[2-9]|[3-9])")

Later, if GAS219_OR_LATER is defined, then code paths that utilize SSE, SSE2, SSE3, double-quad word multiply, AES-NI, etc are utilized.

However, clang does not return a version in response to the query. Rather, it just errors out:

$ clang++ -xc -c /dev/null -Wa,-v -o/dev/null 2>&1
clang: error: unsupported argument '-v' to option 'Wa,'

This is how the assembler is supposed to react (give or take) when running it through the GCC compiler driver:

$ g++ -xc -c /dev/null -Wa,-v -o/dev/null 2>&1
GNU assembler version 2.24 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.

Determining the assembler and its version is critical to us due to issues like https://llvm.org/bugs/show_bug.cgi?id=18916.

Please consume -Wa,-v, and please return a string to identify the integrated assembler.

Quuxplusone commented 9 years ago
And:

    $ clang++ -xc -c /dev/null -Wa,--version -o/dev/null 2>&1
    clang: error: unsupported argument '--version' to option 'Wa,'
Quuxplusone commented 9 years ago

We are tracking this with "Need extensible way to handle Clang Integrated Assembler/LLVM Issues 18916 and 24200", https://github.com/weidai11/cryptopp/issues/11.

Quuxplusone commented 9 years ago

I was just testing similar Clang behavior with the preprocessor via the -Wp options. They look to be OK:

Apple's default

$ clang++ -E -Wp,-version - </dev/null LLVM (http://llvm.org/): LLVM version 3.4svn Optimized build. Default target: x86_64-apple-darwin12.6.0 Host CPU: corei7-avx

LLVM's gear, built from sources

$ /usr/local/bin/clang++ -E -Wp,-version - </dev/null LLVM (http://llvm.org/): LLVM version 3.6.0 Optimized build with assertions. Built Apr 2 2015 (01:25:22). Default target: x86_64-apple-darwin12.6.0 Host CPU: corei7-avx