From owner-freebsd-hackers@freebsd.org Tue Aug 4 21:28:06 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C3F837FC9A for ; Tue, 4 Aug 2020 21:28:06 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-24.consmr.mail.gq1.yahoo.com (sonic311-24.consmr.mail.gq1.yahoo.com [98.137.65.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLnsw6J7pz3f8H for ; Tue, 4 Aug 2020 21:28:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 5wLmmVEVM1n11YOqolKKGxg_hzoDs7OnuSWU7IjpFkq9vw4HQGteq56lyZNL7qf _z1lyA6piUKrIYTRp.KpcvoWIYyGYUKgeeDltbBTYYayfbAvpzBuiFCAS2WPpCAtqQNhrRc_5LLz ndA0mpHtStXXn_J3tJ8tFz5eVM8AT5DZBAgwFrhlivGUh3ECQPZ0J2wE_llb4HgvECSBTOMMMkim LPFVzxuF2dlwR.MJMBdCNS2o5CjwJd6zY5XeNB6Bry7EdBny_3g6S5r0HUfBFs2nu6HvqM_sSduz OmTseX1kuwDTjlOFm2PgGdoqLVK7Vh.hatqDBf192Rm35jZz1klsGQrp8pCgkoAkdkox.XKLfX7_ o1VpTsrJIPmU7XKkcY1BXk6hNBiQ331VSX65mz9H.BgGdx37pvZJd0SkvcDGUoq59gLkb6a8SyYy O2.Syxg1Fb79WmmmNeJqwCKYgqxjCu3EXlL4MKgxd7_hfH9.rNj_OaDDceDalz9FVT6GOdk2q_8L TwwLcpp2SvqqBwx4RAieOMhaFYQMbbaM.OSlnsPaaoR0_LUUxQkOxN232shm.I8GtlcCbnf9LInj NSQS2bJXBO1dDQqpWD5uBv22a6Yn3JfjF3VXxGUkCyJ3OUvbGYrLs4Qd5DmE3X46RwJZIhe44nE5 LW.3yvOcQIbd6zitf46YICx0tR0wOSH5thfnfEtk6hMXH1taPHu5H4ycT7xoEoWkA56YD3K3dBOy FIXSgjglTo08Od1QhZKrvybAgG1VJQDkvkdGV1EHJoZpvN2W4eutYskOS5E2p0bX_BJBEZsIEete vcXFLssqD2eqBKE9HRecOp9G_JA0gCsgGnv8OpCoB5J7907AlKKUBFT_h8Q_CWFWVsnMTAwlbtdH D_mNXAg8.iD3jFBpDLJRQM6d2.Arx6FAz9cpCQkiqDmlKM7E3QhtBq7dZt0Mr5t5zhG5fREyDidX eAsOoK2yV71PVaf1hiwXMNRiWL2PSt4e3iYGb7zWwrDMRIzZ_K3UsyjxOtVCRUb.VGeVpDkVqHio yYO4xYESgbDBTELcEpH.4JdSE.w4Y89UUO36xpL2sGcpRkyKslJpJNm7y_KiKXZYuqG8Pi0r51Nu 72Usun4EAkgV_DIZ5WuRpG6cxKDtnygEmaIx_sSNWmjcvmksIJznDxn8mShMRUL53cCA3t2hcXNZ PjN9fSIPOLqne_1F7jLWkCcyAY0WnVPhVYhHNh9evT6SggfdciJIKMTZJYw_2xZzGFzQmm2yYlbC 7m6fodNJ0.wnNyR7FNUdVlsvFIS4GUdGqPH4_3ZS6lJiYD4672zhFsIo7bBCKm37BlgFQxpEQytO FopZRzBAjfvgbjR0WFnZi.Y6fIGN66S8w8q8L7_8hR27dFjQkW06oLDfmSqhA_PuSPf.mwdReJua XKXDDIC4AxNP9sTyM.g-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.gq1.yahoo.com with HTTP; Tue, 4 Aug 2020 21:28:03 +0000 Received: by smtp425.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 4db425e77024b38f8a4488b90c89909c; Tue, 04 Aug 2020 21:27:59 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: aarch64: unable to use lang/gcc10 to use system libc++, unlike back with lang/gcc9, failure: __aarch64_ldadd8_acq_rel missing Message-Id: Date: Tue, 4 Aug 2020 14:27:58 -0700 To: freebsd-arm , FreeBSD Toolchain , FreeBSD Hackers X-Mailer: Apple Mail (2.3608.120.23.2.1) References: X-Rspamd-Queue-Id: 4BLnsw6J7pz3f8H X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.36 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.205:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; NEURAL_HAM_LONG(-1.01)[-1.008]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.205:from]; NEURAL_HAM_SHORT(-0.81)[-0.805]; NEURAL_HAM_MEDIUM(-1.04)[-1.044]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 21:28:06 -0000 Historically I've been able to use lang/gcc9 to build personal aarch64 c++17 applications that used head's libc++ and the like (other than some floating point support code for aarch64). The redirection of g++9 to system libraries and such looks like: . . . CXX+=3D -Wno-psabi -nostdinc -nostdinc++ -I/usr/include/c++/v1 = -I/usr/include . . . LDCXX=3D -nodefaultlibs -lc++ -lcxxrt -lthr -lm -lc -lgcc_s \ -Wl,-rpath=3D/usr/local/lib/gcc9 . . . # Note: FreeBSD's libgcc_s were missing at least a floating point = routine. # The -Wl,-rpath=3D/usr/local/lib/gcc9 causes use of gcc9's = libgcc_s . # So far I've only had the issue for targeting aarch64 and armv7. . . . I do not know if there is an intention to allow such things vs. if I was just lucky that it worked at the time. Historically I've done the same on powerpc64, 32-bit powerpc, and amd64 as well. On those no -Wl,-rpath=3D... was required. Targeting armv7 did require use of -Wl,-rpath=3D/usr/local/lib/gcc9 . I've just tried the same sort of thing for using lang/gcc10 and targeting aarch64 and it fails to build: CXX+=3D -Wno-psabi -nostdinc -nostdinc++ -I/usr/include/c++/v1 = -I/usr/include . . . LDCXX=3D -nodefaultlibs -lc++ -lcxxrt -lthr -lm -lc -lgcc_s \ -Wl,-rpath=3D/usr/local/lib/gcc10 It ended up failing for: /usr/local/bin/ld: ../objs/cpp_clockinfo-g++_10_O3-libc++.o: in function = `long std::__1::__libcpp_atomic_refcount_decrement(long&)': /usr/include/c++/v1/memory:3386: undefined reference to = `__aarch64_ldadd8_acq_rel' /usr/local/bin/ld: ../objs/cpp_clockinfo-g++_10_O3-libc++.o: in function = `long std::__1::__libcpp_atomic_refcount_increment(long&)': /usr/include/c++/v1/memory:3375: undefined reference to = `__aarch64_ldadd8_relax' /usr/local/bin/ld: ../objs/cpp_clockinfo-g++_10_O3-libc++.o: in function = `long std::__1::__libcpp_atomic_refcount_decrement(long&)': /usr/include/c++/v1/memory:3386: undefined reference to = `__aarch64_ldadd8_acq_rel' /usr/local/bin/ld: /usr/include/c++/v1/memory:3386: undefined reference = to `__aarch64_ldadd8_acq_rel' /usr/local/bin/ld: /usr/include/c++/v1/memory:3386: undefined reference = to `__aarch64_ldadd8_acq_rel' /usr/local/bin/ld: /usr/include/c++/v1/memory:3386: undefined reference = to `__aarch64_ldadd8_acq_rel' /usr/local/bin/ld: /usr/include/c++/v1/memory:3386: undefined reference = to `__aarch64_ldadd8_acq_rel' /usr/local/bin/ld: = ../objs/cpp_clockinfo-g++_10_O3-libc++.o:/usr/include/c++/v1/memory:3386: = more undefined references to `__aarch64_ldadd8_acq_rel' follow collect2: error: ld returned 1 exit status *** Error code 1 Stop. make: stopped in /root/acpphint/acpphint_src (Omitting -Wl,-rpath=3D/usr/local/lib/gcc10 made no difference.) I did not have such an issue for powerpc64. I've not tried the other platforms yet. Anyone know if I'm out in "if it hurts, then do not do that" land? Or is this something that should be possible but is currently broken? Note: The C++ source in question tries to be pure C++17 compliant code for normal builds. (And I was doing a normal build: no FreeBSD specific code or the like enabled.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)