From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id C9EE13858CD1 for ; Sun, 28 Apr 2024 16:17:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C9EE13858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C9EE13858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714321055; cv=none; b=SKygr5h5I3mhizjT9GtUbfheeMjzNtmwILj7qHhvfh1o5geuCm6uKc+nHXuI2Ff8jU5fUuRLdGtvNR2h+JGAtvFLpkEYQY1+ZQjlxJNtwhPS8fwBoBVaeXi3wyrtEmfBtvVsWIEQlK2C9W5m5IiwKSygH3l4duoLu65He3IyLbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714321055; c=relaxed/simple; bh=MUMUQKlZ+hxSA10Ne65fGDeocVBK4xtZ/DiQh+osAHA=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=oxB4x/emgbz4eJNL2yrpvkoh7dMRgqfUQz+6jZz/u6hGSSfCK9mqZEWmxu98cTs66nZIbEvq9YzykYvKjOiQJtQHpLlwHjj9cRiDy7zUbEe4RHagc5tHkdXIbuY0a8EVpT94nTXUuEIfkaw55fTSzlBBvDvYFc21mZAGaCBGvKk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a58c89bda70so271937666b.3 for ; Sun, 28 Apr 2024 09:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714321051; x=1714925851; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lBNij1d33E17wLMrGJea8wPMpI3Yp4zgd3xIsC2t8d4=; b=laC94vYwePALvFjW8ugoa38bXH0by86OuAJ8/NW5t6aJuXhtP1YaRvChSPhI09C+Fz Gt73rcUOXlpGI9gdANM0JZ13WkYb7fMXLH8eYP1RiADDRRfnup+6nrx1yIIv6hHKwrae /gCtlvtsxIHo0AwFTiBHfXsxEDlr9NxtrkWB5Am57VS4agQcoXwd4L2sD4XxOjrVmYG2 cQrz7zdg0IS/jTbTh3tpb0dXKwMMDurgC7vMorq/uUnRzhYUxR5WJOrkf6sN4Fxf/v6J Wetx7Za9IJhTe8C3ytkutKUKDRRZ0v/WnwNdLGYKhiAYZaAUZMAbhxWbWHEOBKJtocVC Sj7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714321051; x=1714925851; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lBNij1d33E17wLMrGJea8wPMpI3Yp4zgd3xIsC2t8d4=; b=f7TVZBbuoJwZOS+LBatrXW4OLc+F7aeBTqENiHjyVzchRhwv406LQwtCBBJqBLBSKa H38sjFmN7K03K9PT34LCv0qkcYP/3fqE+5fawx/2u+z5rG6vUdBOStkUETmJ91wVBTBS Z9LjJjbAQcW3D/5Jh8eFZoxH2fT9lPKkxH1MowBW/mCiUN8lt/Bu7O4PeywBleK4HcIo SHAorRWZGow5+e0wHiCA9HKQrQKMm9aCS7mE78z+zmAzbrFwn+N1tJUcpOsA18Z/OUZu YGpC28HjluSPHdW59OWbM2OBzXRyqYx4VAOg9WTMjCOewFkxd9YRi0cQElRzVXTZmq2T SdOQ== X-Forwarded-Encrypted: i=1; AJvYcCUKDBmf+0bXMg2Rv7E09lgHZ2JvhVOwZmwE4MiCxl7o5sPhS9BbMaxyBtWGIXrWIkNq+sFPkDTtZ6qD0by3ygQ= X-Gm-Message-State: AOJu0Yz1Ewti6QHLMStcQ7U3+m4iG+JIXM2ogHMd2QmSjokUTtrsNtn5 tHGfeiMAAn+2b+bFzmH6S9oCtWp2jNNZlkvtO/+4U9MJR/7JxA8KSaZTATDPMPKYNJkKT0pzayP /DH9xr4hq8WHMH8dWiVsTNNDe1fQ= X-Google-Smtp-Source: AGHT+IFQXFMQ4V4ZVbWNi1kYZ2yaXlKYqGlcBkzdeFrTypp6o/GUinAdEpYSdW8ydF1lfk2/NoT9MHhgPowa9dq/Rak= X-Received: by 2002:a17:906:a8c:b0:a58:8d65:65cf with SMTP id y12-20020a1709060a8c00b00a588d6565cfmr5023945ejf.19.1714321051079; Sun, 28 Apr 2024 09:17:31 -0700 (PDT) MIME-Version: 1.0 References: <866dda5e-c983-ac16-de71-05b685536cd7@pfeifer.com> In-Reply-To: <866dda5e-c983-ac16-de71-05b685536cd7@pfeifer.com> From: Jonathan Wakely Date: Sun, 28 Apr 2024 17:17:18 +0100 Message-ID: Subject: Re: GCC testing on FreeBSD To: Gerald Pfeifer Cc: Andreas Tobler , Lorenzo Salvadore , "gcc@gcc.gnu.org" Content-Type: multipart/alternative; boundary="00000000000047de0406172a7947" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000047de0406172a7947 Content-Type: text/plain; charset="UTF-8" On Sun, 28 Apr 2024, 11:24 Gerald Pfeifer, wrote: > Hi Jonathan, > > On Fri, 26 Apr 2024, Jonathan Wakely wrote: > > How are you testing on FreeBSD? > > > > When I build GCC trunk on FreeBSD 14.0 and try to run the libstdc++ > > testsuite it fails due to lots of these errors: > > > > Excess errors: > > /usr/local/bin/ld: /tmp//ccev946q.o: relocation R_X86_64_32 against > > symbol `_ZTIN10__cxxabiv115__forced_unwindE@@CXXABI_1.3.2' can not be > > used when making a PDE object; recompile with -fPIE > > /usr/local/bin/ld: failed to set dynamic section sizes: bad value > > my first reaction was to recommend using binutils instead of /usr/bin/ld > which is LLD 16.0.6 or similar (since a while ago FreeBSD switched to that > toolchain as part of the base system). > > My nightly tester has been using GNU ld since > > # 2012-03-11 Configure using --with-as=$localbase/bin/as and > # --with-ld=$localbase/bin/ld on *.freebsd.org. > > in the script invoked by cron, even before FreeBSD made that switch. > > Seeing /usr/local/bin/ld in the error message it appears you are doing > that already, though? > Yes, I'm using GNU ld. On IRC Andreas suggested that also using GNU objdump would solve my issue, but I haven't tried yet. > > Which suggests that -fPIE is missing from the default test flags. > > > > Have you seen this? Do you do something locally to work around it? > > All I have in terms of adjustments to the FreeBSD systems I build on via > that script are the following > > CONFIGUREFLAGS="--with-gmp=$LOCALBASE --with-as=$LOCALBASE/bin/as > $CONFIGUREFLAGS" > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LOCALBASE/lib > PATH=$LOCALBASE/bin:$PATH > > where LOCALBASE looks like it would be /usr/local in your case. Nothing > explicit around PIE there. > > Looking at the logs of a serialized build I triggered manually where I > remove the --with-ld configure option, I see > > checking linker PIE support with copy reloc... no > checking for -fno-PIE option... yes > checking for -no-pie option... yes > > and then build invocations like > > c++ -std=c++11 -fno-PIE -c ... > > during all-stage1-target-libgcc which ultimately fails with - mystery?! - > > ld: error: unable to find library -lc > collect2: error: ld returned 1 exit status > gmake[3]: *** [Makefile:1005: libgcc_s.so] Error 1 > > (Disclaimer: all my tests on FreeBSD 13.2, not FreeBSD 14 as in your > case.) > > > Looking at the lang/gcc* ports that I maintained for two decades until > Lorenzo (copied now) kindly took them over two years ago I see the > following change among others for newer versions: > > % git show b6a5871a0cf40 > commit b6a5871a0cf40dfc194217704e2dc03e2e91fb62 > Author: Lorenzo Salvadore > Date: Fri Feb 3 20:12:49 2023 +0100 > > lang/gcc10: Mark PIE_UNSAFE > > Building the port with WITH_PIE fails if the BOOTSTRAP option is > enabled. Mark PIE_UNSAFE when this option is enabled until a better > solution is found. > > PR: 268901 > > where https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268901 is the PR > referenced. > > PIE_UNSAFE=yes in a port's Makefile (the equivalent to a spec file in RPM > land) is used as follows in ports/Mk/Features/pie.mk: > > . if !defined(PIE_UNSAFE) > PIE_CFLAGS?= -fPIE -fPIC > CFLAGS+= ${PIE_CFLAGS} > CXXFLAGS+= ${PIE_CFLAGS} > LDFLAGS+= -pie > STATIC_PIE_ARGS+= -static-pie > . endif > > > You are not using the Ports Infrastructure, I believe, so the above does > not directly apply, may provide some additional background, though? > > > Hope this helps - and please chime in Lorenzo and Andreas! > > Gerald > --00000000000047de0406172a7947--