Bug 233751 - BSD_CRTBEGIN does not work on powerpc
Summary: BSD_CRTBEGIN does not work on powerpc
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: powerpc Any
: --- Affects Only Me
Assignee: Justin Hibbits
Depends on:
Blocks: 233094
  Show dependency treegraph
Reported: 2018-12-03 14:28 UTC by Ed Maste
Modified: 2019-01-12 21:30 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2018-12-03 14:28:48 UTC
See https://lists.freebsd.org/pipermail/svn-src-all/2018-December/173249.html

> /usr/bin/ld: crtsavres.o: No such file: No such file or directory

andrew@ has disabled BSD_CRTBEGIN on powerpc in r341424
Comment 1 Mark Millard 2018-12-04 05:06:45 UTC
Why did https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/8288/
and https://ci.freebsd.org/job/FreeBSD-head-powerpc-build/8576/
(Nov 23) and various later not show failures from the change?

Had the builds been using old crtsavres.o files from prior builds?
(If so, such does not seem to be a good property of the build
Comment 2 Mark Millard 2018-12-04 05:21:47 UTC
(In reply to Mark Millard from comment #1)

I wonder if it is a race condition instead of just-missing

Looking at the build logs I see things like:

--- crtsavres.o ---
. . . 
--- crtsavres.o ---
cc --sysroot=/usr/obj/usr/src/powerpc.powerpc/tmp -B/usr/obj/usr/src/powerpc.powerpc/tmp/usr/bin -x assembler-with-cpp -O2 -pipe   -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 -fno-inline-functions -fno-exceptions  -fno-zero-initialized-in-bss -fno-asynchronous-unwind-tables  -fno-omit-frame-pointer -I/usr/src/contrib/gcclibs/include -I/usr/src/contrib/gcc/config -I/usr/src/contrib/gcc -I.  -I/usr/src/gnu/usr.bin/cc/cc_tools -g  -std=gnu89    -finhibit-size-directive -fno-toplevel-reorder    -c /usr/src/contrib/gcc/config/rs6000/crtsavres.asm  -o crtsavres.o


-- crtsavres.o ---
. . .
--- crtsavres.o ---
cc --sysroot=/usr/obj/usr/src/powerpc.powerpc64/tmp -B/usr/obj/usr/src/powerpc.powerpc64/tmp/usr/bin -x assembler-with-cpp -O2 -pipe   -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 -fno-inline-functions -fno-exceptions  -fno-zero-initialized-in-bss -fno-asynchronous-unwind-tables  -fno-omit-frame-pointer -I/usr/src/contrib/gcclibs/include -I/usr/src/contrib/gcc/config -I/usr/src/contrib/gcc -I.  -I/usr/src/gnu/usr.bin/cc/cc_tools -g  -std=gnu89    -finhibit-size-directive -fno-toplevel-reorder    -c /usr/src/contrib/gcc/config/rs6000/crtsavres.asm  -o crtsavres.o
Comment 3 Mark Millard 2018-12-04 07:47:19 UTC
(In reply to Mark Millard from comment #2)

This may be a duplicate of bugzilla 233733 .
Comment 4 Ed Maste freebsd_committer 2018-12-04 14:25:26 UTC
(In reply to Mark Millard from comment #3)
There is a race condition as well but this PR is not a duplicate -- once PR233733 is fixed powerpc with BSD_CRTBEGIN should consistently fail due to missing crtsavres.o.
Comment 5 Justin Hibbits freebsd_committer 2019-01-12 05:08:32 UTC
Review available at https://reviews.freebsd.org/D18826
Comment 6 commit-hook freebsd_committer 2019-01-12 21:30:30 UTC
A commit references this bug:

Author: jhibbits
Date: Sat Jan 12 21:29:55 UTC 2019
New revision: 342974
URL: https://svnweb.freebsd.org/changeset/base/342974

  Create crtsavres.o for powerpc builds

  GCC expects to link in a crtsavres.o on powerpc platforms.  On
  powerpc64 this is an empty file, but on powerpc and powerpcspe this does contain
  some save/restore functions, which may not actually be necessary for newer
  modern GCC and clang.  This appeases the in-tree gcc, though, and is needed in
  order to switch to the BSD CRTRBEGIN.

  PR:	233751
  Reviewed By: andrew
  Differential Revision: https://reviews.freebsd.org/D18826