From owner-freebsd-bugs@freebsd.org Mon Jul 30 09:18:04 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3360104FEA5 for ; Mon, 30 Jul 2018 09:18:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 7015D8F32E for ; Mon, 30 Jul 2018 09:18:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 356DB104FEA1; Mon, 30 Jul 2018 09:18:03 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13699104FEA0 for ; Mon, 30 Jul 2018 09:18:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A90888F32D for ; Mon, 30 Jul 2018 09:18:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 140BD205E5 for ; Mon, 30 Jul 2018 09:18:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w6U9I1t8040596 for ; Mon, 30 Jul 2018 09:18:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w6U9I1r4040595 for bugs@FreeBSD.org; Mon, 30 Jul 2018 09:18:01 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 230184] clang++ failed to include standard header files if '-stdlib=libstdc++' option is specified Date: Mon, 30 Jul 2018 09:18:02 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: yasu@utahime.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 09:18:04 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D230184 Bug ID: 230184 Summary: clang++ failed to include standard header files if '-stdlib=3Dlibstdc++' option is specified Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: yasu@utahime.org In the OPTIONS section of clang(1) man page '-stdlib' option is explained as following: ---------------------------------------------------------------------- -stdlib=3D Specify the C++ standard library to use; supported options are libstdc++ and libc++. If not specified, platform default will be used. ---------------------------------------------------------------------- But if '-stdlib=3Dlibstdc++' is specified clang++ fails to include standard header files such as 'iostream' or 'cstdio'. yasu@rolling-vm-freebsd1[1724]% uname -a FreeBSD rolling-vm-freebsd1.home.utahime.org 12.0-CURRENT FreeBSD 12.0-CURR= ENT #0 r336739: Sun Jul 29 07:46:09 JST 2018=20=20=20=20 rootz@rolling-vm-freebsd1.home.utahime.org:/usr0/freebsd/base/obj/usr0/free= bsd/base/head/amd64.amd64/sys/GENERIC_UTAHIME amd64 yasu@rolling-vm-freebsd1[1725]% cat Makefile CXX=3D clang++ RM=3D rm -f CXXFLAGS+=3D -stdlib=3Dlibstdc++ TARGETS =3D cpptest01 \ cpptest02 OBJECTS =3D cpptest01.o \ cpptest02.o all: ${TARGETS} cpptest01: cpptest01.o $(CXX) $(CXXFLAGS) -o $@ $> cpptest02: cpptest02.o $(CXX) $(CXXFLAGS) -o $@ $> clean: ${RM} ${TARGETS} ${OBJECTS} yasu@rolling-vm-freebsd1[1726]% cat cpptest01.cpp #include int main(int argc, char **argv) { std::cout << "Hello, World" << std::endl; return 0; } yasu@rolling-vm-freebsd1[1727]% cat cpptest02.cpp #include int main(int argc, char **argv) { std::printf("Hello, World\n"); return 0; } yasu@rolling-vm-freebsd1[1728]% make -k clang++ -O2 -pipe -stdlib=3Dlibstdc++ -c cpptest01.cpp -o cpptest01.o cpptest01.cpp:1:10: fatal error: 'iostream' file not found #include ^~~~~~~~~~ 1 error generated. *** Error code 1 (continuing) clang++ -O2 -pipe -stdlib=3Dlibstdc++ -c cpptest02.cpp -o cpptest02.o cpptest02.cpp:1:10: fatal error: 'cstdio' file not found #include ^~~~~~~~ 1 error generated. *** Error code 1 (continuing) `all' not remade because of errors. yasu@rolling-vm-freebsd1[1728]% --=20 You are receiving this mail because: You are the assignee for the bug.=