From owner-freebsd-current@freebsd.org Sat Oct 7 08:10:45 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FADE31715 for ; Sat, 7 Oct 2017 08:10:45 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-18.reflexion.net [208.70.210.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BCA63AEB for ; Sat, 7 Oct 2017 08:10:44 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 14179 invoked from network); 7 Oct 2017 08:10:43 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 7 Oct 2017 08:10:43 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sat, 07 Oct 2017 04:10:43 -0400 (EDT) Received: (qmail 17648 invoked from network); 7 Oct 2017 08:10:43 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 7 Oct 2017 08:10:43 -0000 Received: from [192.168.1.26] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 92406EC918F; Sat, 7 Oct 2017 01:10:42 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: C++ in jemalloc From: Mark Millard In-Reply-To: Date: Sat, 7 Oct 2017 01:10:42 -0700 Cc: Justin Hibbits , Warner Losh , FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: <528ED3CD-8A4B-4F00-8728-7D231DB0811A@dsl-only.net> <20171007064249.GA73770@vlakno.cz> To: Roman Divacky X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 08:10:46 -0000 [I'm adding examples with output from clang -v since it explicitly shows the path used for ld and such.] On 2017-Oct-7, at 12:58 AM, Mark Millard wrote: > On 2017-Oct-6, at 11:42 PM, Roman Divacky = wrote: >=20 >> Just to clarify my not agreeing with Mark regarding EH on ppc64. >>=20 >> Last time I tried to fix ppc64 exceptions handling as generated by = clang >> it turned out that simply using gnu ld from ports fixes the issue. >>=20 >> For details see: >> = https://lists.freebsd.org/pipermail/freebsd-toolchain/2017-May/002961.html= >=20 > Unfortunately my experiments failed to confirm this. Repeating > them now under head -r324071 and ports -r450478 : >=20 > # more exception_test.cpp=20 > #include >=20 > int main(void) > { > try { throw std::exception(); } > catch (std::exception& e) {} > return 0; > } >=20 > # clang++ -B /usr/local/powerpc64-freebsd/bin -std=3Dc++14 -g -O2 = exception_test.cpp >=20 > # ./a.out > Segmentation fault (core dumped) >=20 > # clang++ -B /usr/local/powerpc64-freebsd/bin -std=3Dc++11 -g = exception_test.cpp >=20 > # ./a.out > Segmentation fault (core dumped) # clang++ -v -B /usr/local/powerpc64-freebsd/bin -std=3Dc++11 -g = exception_test.cpp FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based on = LLVM 5.0.0svn) Target: powerpc64-unknown-freebsd12.0 Thread model: posix InstalledDir: /usr/bin "/usr/bin/clang++" -cc1 -triple powerpc64-unknown-freebsd12.0 -emit-obj = -mrelax-all -disable-free -main-file-name exception_test.cpp = -mrelocation-model pic -pic-level 2 -mthread-model posix = -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu ppc64 = -mfloat-abi hard -v -dwarf-column-info -debug-info-kind=3Dstandalone = -dwarf-version=3D2 -debugger-tuning=3Dgdb -resource-dir = /usr/lib/clang/5.0.0 -internal-isystem /usr/include/c++/v1 -std=3Dc++11 = -fdeprecated-macro -fdebug-compilation-dir /root/c_tests -ferror-limit = 19 -fmessage-length 200 -fno-signed-char -fobjc-runtime=3Dgnustep = -fcxx-exceptions -fexceptions -fdiagnostics-show-option = -fcolor-diagnostics -o /tmp/exception_test-ba79a4.o -x c++ = exception_test.cpp clang -cc1 version 5.0.0 based upon LLVM 5.0.0svn default target = powerpc64-unknown-freebsd12.0 #include "..." search starts here: #include <...> search starts here: /usr/include/c++/v1 /usr/lib/clang/5.0.0/include /usr/include End of search list. "/usr/local/powerpc64-freebsd/bin/ld" --eh-frame-hdr -dynamic-linker = /libexec/ld-elf.so.1 --enable-new-dtags -o a.out /usr/lib/crt1.o = /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib = /tmp/exception_test-ba79a4.o -lc++ -lm -lgcc --as-needed -lgcc_s = --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed = /usr/lib/crtend.o /usr/lib/crtn.o # ./a.out Segmentation fault (core dumped) > # ls -lt /usr/local/powerpc64-freebsd/bin > total 56704 > lrwxr-xr-x 1 root wheel 32 Jul 2 19:27 size -> = ../../bin/powerpc64-freebsd-size > -r-xr-xr-x 4 root wheel 7072791 Jul 2 19:27 ld > -r-xr-xr-x 4 root wheel 7072791 Jul 2 19:27 ld.bfd > -r-xr-xr-x 2 root wheel 6881822 Jul 2 19:27 as > -r-xr-xr-x 2 root wheel 6128889 Jul 2 19:27 strip > -r-xr-xr-x 2 root wheel 5253417 Jul 2 19:27 nm > -r-xr-xr-x 2 root wheel 1284139 Jul 2 19:27 readelf > -r-xr-xr-x 2 root wheel 6128882 Jul 2 19:27 objcopy > -r-xr-xr-x 2 root wheel 5384166 Jul 2 19:27 ranlib > -r-xr-xr-x 2 root wheel 5384159 Jul 2 19:27 ar > -r-xr-xr-x 2 root wheel 6914775 Jul 2 19:27 objdump >=20 > # clang++ -B /usr/local/powerpc64-portbld-freebsd12.0/bin/ -std=3Dc++14 = -g -O2 exception_test.cpp >=20 > # ./a.out > Segmentation fault (core dumped) # clang++ -v -B /usr/local/powerpc64-portbld-freebsd12.0/bin/ -std=3Dc++14= -g -O2 exception_test.cpp FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based on = LLVM 5.0.0svn) Target: powerpc64-unknown-freebsd12.0 Thread model: posix InstalledDir: /usr/bin "/usr/bin/clang++" -cc1 -triple powerpc64-unknown-freebsd12.0 -emit-obj = -disable-free -main-file-name exception_test.cpp -mrelocation-model pic = -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose = -mconstructor-aliases -target-cpu ppc64 -mfloat-abi hard -v = -dwarf-column-info -debug-info-kind=3Dstandalone -dwarf-version=3D2 = -debugger-tuning=3Dgdb -resource-dir /usr/lib/clang/5.0.0 = -internal-isystem /usr/include/c++/v1 -O2 -std=3Dc++14 = -fdeprecated-macro -fdebug-compilation-dir /root/c_tests -ferror-limit = 19 -fmessage-length 200 -fno-signed-char -fobjc-runtime=3Dgnustep = -fcxx-exceptions -fexceptions -fdiagnostics-show-option = -fcolor-diagnostics -vectorize-loops -vectorize-slp -o = /tmp/exception_test-3ebf72.o -x c++ exception_test.cpp clang -cc1 version 5.0.0 based upon LLVM 5.0.0svn default target = powerpc64-unknown-freebsd12.0 #include "..." search starts here: #include <...> search starts here: /usr/include/c++/v1 /usr/lib/clang/5.0.0/include /usr/include End of search list. "/usr/local/powerpc64-portbld-freebsd12.0/bin/ld" --eh-frame-hdr = -dynamic-linker /libexec/ld-elf.so.1 --enable-new-dtags -o a.out = /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib = /tmp/exception_test-3ebf72.o -lc++ -lm -lgcc --as-needed -lgcc_s = --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed = /usr/lib/crtend.o /usr/lib/crtn.o # ./a.out Segmentation fault (core dumped) > # clang++ -B /usr/local/powerpc64-portbld-freebsd12.0/bin/ -std=3Dc++11 = -g exception_test.cpp >=20 > # ./a.out > Segmentation fault (core dumped) >=20 >=20 > # ls -lt /usr/local/powerpc64-portbld-freebsd12.0/bin/ > total 363584 > -r-xr-xr-x 4 root wheel 59993201 Jul 2 23:44 ld > -r-xr-xr-x 4 root wheel 59993201 Jul 2 23:44 ld.bfd > -r-xr-xr-x 2 root wheel 29843304 Jul 2 23:44 as > -r-xr-xr-x 2 root wheel 29046519 Jul 2 23:44 strip > -r-xr-xr-x 2 root wheel 28207257 Jul 2 23:44 nm > -r-xr-xr-x 2 root wheel 1178483 Jul 2 23:44 readelf > -r-xr-xr-x 1 root wheel 28329180 Jul 2 23:44 dlltool > -r-xr-xr-x 2 root wheel 29046512 Jul 2 23:44 objcopy > -r-xr-xr-x 2 root wheel 28334599 Jul 2 23:44 ranlib > -r-xr-xr-x 2 root wheel 28334592 Jul 2 23:44 ar > -r-xr-xr-x 2 root wheel 49540244 Jul 2 23:44 objdump =3D=3D=3D Mark Millard markmi at dsl-only.net