From owner-svn-src-all@freebsd.org Tue Jun 5 12:06:35 2018 Return-Path: Delivered-To: svn-src-all@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 42652FF1824; Tue, 5 Jun 2018 12:06:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CD7373661; Tue, 5 Jun 2018 12:06:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id QAjJfeIb8uYopQAjKfPI0G; Tue, 05 Jun 2018 06:06:27 -0600 X-Authority-Analysis: v=2.3 cv=GopsBH9C c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=xfDLHkLGAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=J7jIlIlCvbTruzeGJHcA:9 a=1DzDg_EYHYBtquMQ:21 a=TwhC9JfmmZpoJfKh:21 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id D5F15FAB; Tue, 5 Jun 2018 05:06:24 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w55C6O02035542; Tue, 5 Jun 2018 05:06:24 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w55C6O4K035526; Tue, 5 Jun 2018 05:06:24 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806051206.w55C6O4K035526@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ganbold Tsagaankhuu cc: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334626 - in head: lib/libc/amd64 lib/libc/amd64/sys lib/libc/arm lib/libc/arm/sys lib/libc/i386 lib/libc/i386/sys lib/libc/mips lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys ... In-Reply-To: Message from Ganbold Tsagaankhuu of "Tue, 05 Jun 2018 15:50:12 +0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Jun 2018 05:06:24 -0700 X-CMAE-Envelope: MS4wfMJOoQXU1dmPvLtZIvo94DsCFBtebXTsIS+Nsk9AWTvOjJteV6g8eF/gAamRVmHRX/c1zhJEdfAZDQZHlkKD6FST94KqeDJ4DGKryxrRMwshE/oLaShy wrtYPKawqxfU7T3NhqtfmCmIgd5f49VQM1NUop6yQ4RZBuJZ7yeE+VcUI5lA5CK4bHCjOlQfXd/yJM9mlpA+sGw8RopoeoBFE2TbrKDIwB0WDrMiv65kCZIl +TFkB8xrLkvUMt/yjTscErLIn20XsPlM5DujggZdxt13tgOFXxdPx2RF0Rf6k51A X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 12:06:35 -0000 In message , Ganbold Tsagaankhuu writes: > On Tue, Jun 5, 2018 at 3:35 AM, Mark Johnston wrote: > > > Author: markj > > Date: Mon Jun 4 19:35:15 2018 > > New Revision: 334626 > > URL: https://svnweb.freebsd.org/changeset/base/334626 > > > > Log: > > Reimplement brk() and sbrk() to avoid the use of _end. > > > > Previously, libc.so would initialize its notion of the break address > > using _end, a special symbol emitted by the static linker following > > the bss section. Compatibility issues between lld and ld.bfd could > > cause the wrong definition of _end (libc.so's definition rather than > > that of the executable) to be used, breaking the brk()/sbrk() > > interface. > > > > Avoid this problem and future interoperability issues by simply not > > relying on _end. Instead, modify the break() system call to return > > the kernel's view of the current break address, and have libc > > initialize its state using an extra syscall upon the first use of the > > interface. As a side effect, this appears to fix brk()/sbrk() usage > > in executables run with rtld direct exec, since the kernel and libc.so > > no longer maintain separate views of the process' break address. > > > > > Maybe it is not really related, or I'm doing something wrong, but when I > try to run release.sh script on FreeBSD 11.0-RELEASE-p9 to build pine64 > image, it stops with error: > ... > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk > >>> referenced by brk_test.c:52 (/usr/src/lib/libc/tests/sys/brk_test.c:52) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk > >>> referenced by brk_test.c:55 (/usr/src/lib/libc/tests/sys/brk_test.c:55) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk > >>> referenced by brk_test.c:59 (/usr/src/lib/libc/tests/sys/brk_test.c:59) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: brk > >>> referenced by brk_test.c:65 (/usr/src/lib/libc/tests/sys/brk_test.c:65) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk > >>> referenced by brk_test.c:67 (/usr/src/lib/libc/tests/sys/brk_test.c:67) > >>> brk_test.o:(atfu_brk_basic_body) > > /usr/obj/usr/src/arm64.aarch64/tmp/usr/bin/ld: error: undefined symbol: sbrk > >>> referenced by brk_test.c:82 (/usr/src/lib/libc/tests/sys/brk_test.c:82) > >>> brk_test.o:(atfu_sbrk_basic_body) > ... > > Ganbold Do a clean build or at the very least remove all libc objects and depends, the while directory in /usr/obj, and build again. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.