Opened 9 years ago

Last modified 9 years ago

#8928 new Bugs

Build failed boost 1.54 on Mac with zlib source (-sZLIB_SOURCE) with clang and c++11

Reported by: Tetsuya Hayashi <tetsu.h@…> Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

build fail where compile zlib source in build.v2/standalone/zlib. It is because cxxflags are provided even if compile c source code by clang++ -x c.

    "clang++" -x c -O3 -fPIC -std=c++11 -stdlib=libc++ -O3 -finline-functions -Wno-inline -Wall -DNDEBUG -I"/opt/work/zlib-1.2.8" -c -o "bin.v2/standalone/zlib/clang-darwin-4.2.1/release/link-static/threading-multi/adler32.o" "/opt/work/zlib-1.2.8/adler32.c"

error: invalid argument '-std=c++11' not allowed with 'C/ObjC'
./b2 -d2 -sZLIB_SOURCE=/opt/work/zlib-1.2.8 link=shared,static toolset=clang cxxflags=-std=c++11 cxxflags=-stdlib=libc++ cxxflags=-fPIC cxxflags="-arch x86_64" linkflags=-stdlib=libc++ linkflags=-headerpad_max_install_names linkflags="-arch x86_64"
Mac OS X 10.8.4
% clang --version
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix

Attachments (1)

clang-darwin-cxxflags.patch (511 bytes ) - added by Tetsuya Hayashi <tetsu.h@…> 9 years ago.

Download all attachments as: .zip

Change History (2)

by Tetsuya Hayashi <tetsu.h@…>, 9 years ago

Attachment: clang-darwin-cxxflags.patch added

comment:1 by Tetsuya Hayashi <tetsu.h@…>, 9 years ago

atached patch clang-darwin-cxxflags.patch to fix this issue.

Note: See TracTickets for help on using tickets.