From owner-freebsd-ports-bugs@freebsd.org Wed Feb 7 20:23:11 2018 Return-Path: Delivered-To: freebsd-ports-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 BC563ECBA44 for ; Wed, 7 Feb 2018 20:23:11 +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 375527D64A for ; Wed, 7 Feb 2018 20:23:11 +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 35FD4263D4 for ; Wed, 7 Feb 2018 20:23:10 +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 w17KNASS063336 for ; Wed, 7 Feb 2018 20:23:10 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w17KNADq063335 for freebsd-ports-bugs@FreeBSD.org; Wed, 7 Feb 2018 20:23:10 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: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 225741] java/openjdk7 java/openjdk8: Fix i386 build when base ld is lld Date: Wed, 07 Feb 2018 20:23:09 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: glewis@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name attachments.created 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-ports-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 20:23:12 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225741 Bug ID: 225741 Summary: java/openjdk7 java/openjdk8: Fix i386 build when base ld is lld Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: glewis@FreeBSD.org Reporter: dim@FreeBSD.org Flags: maintainer-feedback?(glewis@FreeBSD.org) Assignee: glewis@FreeBSD.org Created attachment 190400 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D190400&action= =3Dedit Add -Wl,-z,notext to openjdk[78] link flags When building either opendjk7 or openjdk8 on i386, with /usr/bin/ld pointin= g to lld (e.g. using the WITH_LLD_IS_LD option), it dies with many errors of the form: [...] Linking vm... /usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: .L.str in readonly segment; recompile object files with -fPIC >>> defined in adaptiveFreeList.o >>> referenced by adaptiveFreeList.cpp >>> adaptiveFreeList.o:(AdaptiveFreeList::print_on= (outputStream*, char const*) const) /usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: .L.str.1 in readonly segment; recompile object files with -fPIC >>> defined in adaptiveFreeList.o >>> referenced by adaptiveFreeList.cpp >>> adaptiveFreeList.o:(AdaptiveFreeList::print_on= (outputStream*, char const*) const) What is happening here is that lld has the "-z text" option on by default (which produces errors when binaries have dynamic relocations in read-only sections), as opposed to BFD ld. For some reason, the openjdk build process does not look at, or care about,= the value of LDFLAGS, but uses its own variable LFLAGS for this purpose. This patch adds LFLAGS=3D"-Wl,-z,notext" to MAKE_ENV for both openjdk7 and openjdk8, which turns off the checks for dynamic relocations, and makes the ports build with lld on i386. (A future task could attempt to investigate why these text relocations exis= t at all, possibly due to some files not being correctly compiled with -fPIC, but this is much more intrusive.) --=20 You are receiving this mail because: You are the assignee for the bug.=