From nobody Sun Oct 29 17:11:15 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SJNGr5HZCz4xxBB for ; Sun, 29 Oct 2023 17:11:32 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic314-19.consmr.mail.gq1.yahoo.com (sonic314-19.consmr.mail.gq1.yahoo.com [98.137.69.82]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SJNGq3n9vz4DSh for ; Sun, 29 Oct 2023 17:11:31 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=hb+tssqP; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.82 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1698599488; bh=02eCBTwwz19WzF7MiFdqoY22kTFwHH5ZHN2NGOE4QL0=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=hb+tssqPCHTle3ps8ewTXrr5RwxxRNUY8PecfJJHWPFLOGiaTR4r81DEjzsW5ljXNzgjQb1bfVy7SzLVNSMt6FnbTV5VV5hky0q1hFPxdRnuI42CmvN5H7eLCXHC0QSCesk3G9IdkbpWVmnkF9V3RLH8EX9mihW4V0ZQgpr39zJl70mJqyMOeXzkV2KaFtiwLMJs5cOHa2l4SKaTvb0juRC0R54kfk2X1KaQG56o1m/5fIZFc4nrMEMhS+COTwuQF+Jslgnc4vk5sdGyoBT/+rTUXXT4h5iDsOH/lQyuctWL5wlGUelVtJlyHXHLYY6cmCEErBUx3AmgEroirg3O2A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1698599488; bh=7Q6qaq9zYLdrd24dbRwdGA8gtl1ZO+qHKLuMFEHX37P=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=CHBRs89jbIJJ/xjphw0QtU9SeB9UY9VXRb5Rmfz3xt9Kn1Fj4O259bvnmD+b+9etYRuErUqh5N0ZzwhqbBiWb+0n5tfUR5iDnKXvVEWpBoyjwcHoVZS137xaIbAFP4yDowlqidSpAL1IVapzKtE+9I0h1hwcEYYZMZtv87FSLOOzhh8T/AN/v2Ni4mMP5oP2iVnfpChaLWDTKiEUKv9fOSOceZA0fN+a7L8PIu8dmItgHeF029QKXh29YzcS6S9L4TYttAlB25KeqMbYrI7e7nh23Bp91mRXcwytO5mofvou8SvBc2TNla/zGX5H3rTa/ZNooxQAHRuK4F1IeBm35A== X-YMail-OSG: iO0yzREVM1kwekBcB70wvsxS2w0_PebKDFwFvB.omiFqJsAo7aGGNvllVSSFdsA cCTj_xTUzggaeqVsxNtljQKJELSdJu1mYJZwye0UE0lOB.4al2pzVSl5b_kOVmXInHH8cR9yNaRe Qui_E9hWJyOEqKUw3.UIS6Dvg.lpSXYqOmaPPqy0BDh2a04SgTqlIdxzbU_A0Hz6mZOe89FRg6.x _2O9ZJAuNDIalKiqaN758kkxgCRPgtdNsUjri3nL28ToIT2DDK1g4OxhNf_yZqFp5PNeI7_V17jc oTiybnWUMe5IRixwk7uzzpyyNhLwey4w_kTB65yBNPCQT8EGgmg9.8m3qUszRkePlnKY8EnFFNhA D08wSJaC5ypnJVx3bAbwVImGr_RD3Dc2JnUVjo4iUeux4qyRXckV8_Z.BQ72F2MMoDjDlhdLO_8G 7hr6xJUvyPqqe80CelOWDaOH9gGOxdUkEFYcyv3_EQ_Y.ioe_GkzRZtdGm45v9u6H6lJeusIFHFz JMH2gcVF.yCWhusfd1q09hGM2cOEVv4b4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nA173ad9olrKsTVSZXtGNpSDkEhbEUof8TQbx9g9y7 Y315d2RRCNaQPSkp0nzuWOKuRFciJKJgGfGR0pC7f9X9dIqyvkZhL8.OsYiseSDtf.9AA5KjoKtC 2ZtGnvYkSljnmJgu9RXZpAtJwT3OV8SMv5lZ2dqJxLOAPX_ZwNdYdITdUGS65VyXl1h_Cg2eDWuV FDm.ZQGeT1LnOwG3.gIX9z.TB1TvlT80kf6eOLs0kKHB_meTj79u11EMaZvL_6oFSu.lq78BvAns CcMxpjux0cLoxcCwEYk1nF1fX_VSl2PiCnd1m_b63AUqDg_94gZhjbJwlpGl01ObwxZ4Fb4A0FRn Rvpd6ait0ruq6sza7OCdNJK1.JiQ9IPB.teLOPz8comQyD0ACGi_GsFPa41z3iqAmbJsibCB_y6y N1d7Zg7bmkxi4jOXe0KmO7ZPau15_uOnwQ1673NxgDGco8bqWlD920pxud6wu5NhYAlK3mJ9TZ8k ZE_5.g5PPgso20FilssPqyPKBHyJyM8r6eU.zYITfokJq2HZGAuFiDf7.eqsVeaoYT_R80NM9MTu 8MldL3j1zHgDaQS_0y0tPpT1eo.i9qUNMA6dqfGF_RZX7gs0vlOa1fmj85er29YqEzQ1otQ_IGPe _2jGOOr1Tt6Ha_uFmS.DeD7dWbIVcsI947h9HP_f24zWdf6cPzsBaW.95XKGucvHZ1.qgh8y8u.Y - X-Sonic-MF: X-Sonic-ID: 08fabeff-3184-400e-a588-29e8ab41fd2d Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Sun, 29 Oct 2023 17:11:28 +0000 Received: by hermes--production-gq1-59b5df67b6-ffk59 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0478576d0f5b2b7c1f9a635ae36fc4b1; Sun, 29 Oct 2023 17:11:26 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: problem linking kernel Message-Id: Date: Sun, 29 Oct 2023 10:11:15 -0700 To: Wojciech Puchar , Dimitry Andric , FreeBSD Toolchain , FreeBSD Hackers X-Mailer: Apple Mail (2.3774.200.91.1.1) References: X-Spamd-Result: default: False [-2.55 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.55)[-0.552]; MV_CASE(0.50)[]; SUBJECT_ENDS_SPACES(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.82:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.82:from]; DKIM_TRACE(0.00)[yahoo.com:+]; TO_DN_ALL(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4SJNGq3n9vz4DSh X-Spamd-Bar: -- From: Wojciech Puchar wrote on Date: Sun, 29 Oct 2023 12:16:31 UTC : > reason found. >=20 >=20 > /usr/local/bin/ld which is part of gcc from ports takes precedence I've run into the FreeBSD system toolchain using a linker that was below /usr/local/ multiple times before. I try to avoid building ports that results in the conflict. But, in my view, the FreeBSD toolchain should require an explicit command line option to be willing to use part of a toolchain that is someplace under /usr/local/ instead of using its own toolchain materials for everything. See, for example, my report from 2022-Sept: = https://lists.freebsd.org/archives/freebsd-toolchain/2022-September/000898= .html where, in an aarch64 context, it used: /usr/local/bin/aarch64-unknown-freebsd14.0-ld instead of: /sur/bin/ld or: /usr/bin/dl.lld It did not do this if -fuse-ld=3Dlld was explicitly indicated on the command line: one way to avoid the problem. What is used can be seen in the extra output from use of: clang++ -v Back then the example was: clang++ -v -std=3Dc++20 -Wpedantic -Wall -Wextra -I../other_src_used = -pedantic -g3 -O3 -mcpu=3Dcortex-a72 -flto=3Dthin -pthread -flto=3Dthin = ../objs/cpp_thousandslocale-clang++_14_O3lto-libc++.o = ../objs/cpp_clockinfo-clang++_14_O3lto-libc++.o -o = ../cpp_clockinfo_main-HoneyComb-65536MiB-threads_16-LP64-FreeBSD_main_n256= 584_5bc926af9fd1_64bit-clang++_14_O3lto-libc++ = -DCPPCLOCKINFO_VERS=3D'"acpphint_0.1.24"' = ../other_src_used/cpp_clockinfo_main.cpp FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git = llvmorg-14.0.5-0-gc12386ae247c) Target: aarch64-unknown-freebsd14.0 Thread model: posix InstalledDir: /usr/bin "/usr/bin/clang++" -cc1 -triple aarch64-unknown-freebsd14.0 = -emit-llvm-bc -flto=3Dthin -flto-unit -disable-free = -clear-ast-before-backend -disable-llvm-verifier -discard-value-names = -main-file-name cpp_clockinfo_main.cpp -mrelocation-model static = -mframe-pointer=3Dnon-leaf -ffp-contract=3Don -fno-rounding-math = -mconstructor-aliases -funwind-tables=3D2 -target-cpu cortex-a72 = -target-feature +v8a -target-feature +fp-armv8 -target-feature +neon = -target-feature +crc -target-feature +crypto -target-feature +sha2 = -target-feature +aes -target-abi aapcs = -fallow-half-arguments-and-returns -mllvm = -treat-scalable-fixed-error-as-warning -debug-info-kind=3Dstandalone = -dwarf-version=3D4 -debugger-tuning=3Dgdb -v = -fcoverage-compilation-dir=3D/root/acpphint/acpphint_src -resource-dir = /usr/lib/clang/14.0.5 -I ../other_src_used -D = "CPPCLOCKINFO_VERS=3D\"acpphint_0.1.24\"" -internal-isystem = /usr/include/c++/v1 -O3 -Wpedantic -Wall -Wextra -pedantic -std=3Dc++20 = -fdeprecated-macro -fdebug-compilation-dir=3D/root/acpphint/acpphint_src = -ferror-limit 19 -pthread -fno-signed-char -fgnuc-version=3D4.2.1 = -fno-implicit-modules -fcxx-exceptions -fexceptions -fcolor-diagnostics = -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=3D1 = -o /tmp/cpp_clockinfo_main-56273f.o -x c++ = ../other_src_used/cpp_clockinfo_main.cpp clang -cc1 version 14.0.5 based upon LLVM 14.0.5 default target = aarch64-unknown-freebsd14.0 #include "..." search starts here: #include <...> search starts here: ../other_src_used /usr/include/c++/v1 /usr/lib/clang/14.0.5/include /usr/include End of search list. "/usr/local/bin/aarch64-unknown-freebsd14.0-ld" --eh-frame-hdr = -dynamic-linker /libexec/ld-elf.so.1 --enable-new-dtags -o = ../cpp_clockinfo_main-HoneyComb-65536MiB-threads_16-LP64-FreeBSD_main_n256= 584_5bc926af9fd1_64bit-clang++_14_O3lto-libc++ /usr/lib/crt1.o = /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib -plugin = /usr/bin/../lib/LLVMgold.so -plugin-opt=3Dmcpu=3Dcortex-a72 = -plugin-opt=3DO3 -plugin-opt=3Dthinlto = ../objs/cpp_thousandslocale-clang++_14_O3lto-libc++.o = ../objs/cpp_clockinfo-clang++_14_O3lto-libc++.o = /tmp/cpp_clockinfo_main-56273f.o -lc++ -lm -lgcc --as-needed -lgcc_s = --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed = /usr/lib/crtend.o /usr/lib/crtn.o /usr/local/bin/aarch64-unknown-freebsd14.0-ld: = /usr/bin/../lib/LLVMgold.so: error loading plugin: Cannot open = "/usr/bin/../lib/LLVMgold.so" clang++: error: linker command failed with exit code 1 (use -v to see = invocation) *** Error code 1 Note the: "/usr/local/bin/aarch64-unknown-freebsd14.0-ld" after the = search list. It looks like I did not report my PATH back then. But finding and using aarch64-unknown-freebsd14.0-ld is not going to be found under any system path for the system toolchain. So my view is that the name should not be looked for by the system toolchain --or should be last if the normal system names are not found. FYI: # echo $PATH = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/home/roo= t/bin and it is unlikely to have had any changes since back then. > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/games make >=20 > and all builds >=20 > On Sun, 29 Oct 2023, Dimitry Andric wrote: >=20 > > On 29 Oct 2023, at 11:34, Wojciech Puchar wrote: > >> > >> i get this linking my custom kernel. No errors until link > >> > >> linking kernel > >> ld: dynamic STT_GNU_IFUNC symbol `rdtsc_ordered' with pointer = equality in `cpu_machdep.o' can not be used when making an executable; = recompile with -fPIE and relink with -pie > >> > >> > >> kernel config attached, latest FreeBSD-13 downloaded today. > >> > >> can you help? > > > > I just tried it here, and it works fine: > > > > ... > > linking kernel > > objcopy --strip-debug kernel > > text data bss dec hex filename > > 7925073 779012 3411328 12115413 0xb8ddd5 kernel > > -------------------------------------------------------------- > >>>> Kernel build for PUCHAR completed on Sun Oct 29 12:06:08 UTC 2023 > > -------------------------------------------------------------- > >>>> Kernel(s) PUCHAR built in 28 seconds, ncpu: 32, make -j32 > > -------------------------------------------------------------- > > =3D=3D=3D Mark Millard marklmi at yahoo.com