Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Jun 2018 05:06:24 -0700
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Ganbold Tsagaankhuu <ganbold@gmail.com>
Cc:        Mark Johnston <markj@freebsd.org>, 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 ...
Message-ID:  <201806051206.w55C6O4K035526@slippy.cwsent.com>
In-Reply-To: Message from Ganbold Tsagaankhuu <ganbold@gmail.com> of "Tue, 05 Jun 2018 15:50:12 %2B0800." <CAGtf9xNWtzDZRKOVLK37U3kru-btDbmxLjisWTfCePhqZ-M=YA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <CAGtf9xNWtzDZRKOVLK37U3kru-btDbmxLjisWTfCePhqZ-M=YA@mail.gma
il.com>
, Ganbold Tsagaankhuu writes:
> On Tue, Jun 5, 2018 at 3:35 AM, Mark Johnston <markj@freebsd.org> 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 <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806051206.w55C6O4K035526>