llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.12k stars 12.01k forks source link

"section type does not match previous section type" with -no-integrated as #24627

Open 70311826-e6d8-4d29-8604-c4ec4bfa7f0d opened 9 years ago

70311826-e6d8-4d29-8604-c4ec4bfa7f0d commented 9 years ago
Bugzilla Link 24253
Version 3.6
OS MacOS X
Attachments algparam.s file (temporary artifact), algparam.ii file (temporary artifact)

Extended Description

We are performing some testing on OS X 10.8.5, fully patched. Disabling the integrated assembler results in the following when compiling a particular source file:

section type does not match previous section type

Here's the invocation:

$ export CXX="clang++ -no-integrated-as"
$ export CXXFLAGS="-g2 -O3 -DNDEBUG -DCRYPTOPP_DISABLE_ASM --save-temps"
$ make clean && make
...
clang++ -no-integrated-as -g2 -O3 -DNDEBUG -DCRYPTOPP_DISABLE_ASM --save-temps -fPIC -march=native -DCRYPTOPP_DISABLE_ASM -Wall -Wno-tautological-compare -pipe -c algparam.cpp
algparam.s:2718:section type does not match previous section type

algparam.cpp can be found at https://github.com/weidai11/cryptopp/blob/master/algparam.cpp.

llvmbot commented 9 years ago

It's /usr/bin/as that's changing.

llvmbot commented 9 years ago

In newer clang on Darwin -no-integrated-as means "generate a .s file first, then assemble it" rather than "use the old assembler."

With current trunk I still see clang running

/usr/bin/as" -Q -arch x86_64 -force_cpusubtype_ALL -o algparam.o algparam.s

llvmbot commented 9 years ago

In newer clang on Darwin -no-integrated-as means "generate a .s file first, then assemble it" rather than "use the old assembler."

There are some crazy projects (mainly open source stuff on macports/homebrew style stuff, I think) that use that w/ a shim script to do processing on the .s file in-flight. They're terrible, terrible things I use to frighten young engineers on dark and stormy nights.

llvmbot commented 9 years ago

I don't think -no-integrated-as is supported at all on OS X. I get way more errors:

algparam.s:2:Unknown pseudo-op: .macosx_version_min algparam.s:2:Rest of line ignored. 1st junk character valued 49 (1). algparam.s:39:Unknown pseudo-op: .cfi_startproc algparam.s:43:Unknown pseudo-op: .cfi_def_cfa_offset algparam.s:43:Rest of line ignored. 1st junk character valued 49 (1). ...

Jim, should we just start producing an error in the clang driver if -no-integrated-as is used on OS X?