Bug 253727 - [patch] 13-BETA install fails with "regcomp@FBSD_1.6" when invoked on non-build machine with older version system
Summary: [patch] 13-BETA install fails with "regcomp@FBSD_1.6" when invoked on non-bui...
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 13.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Kyle Evans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-20 19:33 UTC by ota
Modified: 2021-03-02 03:39 UTC (History)
4 users (show)

See Also:


Attachments
LD_LIBRARY_PATH patch (1.29 KB, patch)
2021-02-27 23:09 UTC, ota
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ota 2021-02-20 19:33:13 UTC
I had built world/kernel on 13-BETA releases.  After install, I had incrementally run build world and kernel.

Then, I detached a USB disk with /usr/src /usr/obj and connected to 12.2-RELEASE and run make installkernel.

The 12.2-RELEASE fails to find a library for boot-strapping "make".

$ make installkernel -C /usr/src
--------------------------------------------------------------
>>> Install check kernel
--------------------------------------------------------------
--------------------------------------------------------------
>>> Installing kernel GENERIC on Fri Feb 19 00:42:38 EST 2021
--------------------------------------------------------------
cd /usr/obj/usr/src/i386.i386/sys/GENERIC;  MACHINE_ARC
H=i386  MACHINE=i386  CPUTYPE= CC="cc -target i386-unk
nown-freebsd13.0 --sysroot=/usr/obj/usr/src/i386.i386/tmp -
B/usr/obj/usr/src/i386.i386/tmp/usr/bin" CXX="c++  -target i
386-unknown-freebsd13.0 --sysroot=/usr/obj/usr/src/i386.i38
6/tmp -B/usr/obj/usr/src/i386.i386/tmp/usr/bin"  CPP="cpp -
target i386-unknown-freebsd13.0 --sysroot=/usr/obj/usr/src/i3
86.i386/tmp -B/usr/obj/usr/src/i386.i386/tmp/usr/bin"  AS="
as" AR="ar" LD="ld" LLVM_LINK=""  NM=nm OBJCOPY="objcop
y"  RANLIB=ranlib STRINGS=  SIZE="size" STRIPBIN="strip" PAT
H=/usr/obj/usr/src/i386.i386/tmp/bin:/usr/obj/usr/src/i386.i
386/tmp/usr/sbin:/usr/obj/usr/src/i386.i386/tmp/usr/bin:/us
r/obj/usr/src/i386.i386/tmp/legacy/usr/sbin:/usr/obj/usr/src
/i386.i386/tmp/legacy/usr/bin:/usr/obj/usr/src/i386.i386/tm
p/legacy/bin:/usr/obj/usr/src/i386.i386/tmp/legacy/usr/libe
xec::/sbin:/bin:/usr/sbin:/usr/bin  make  KERNEL=kernel install
ld-elf.so.1: /usr/obj/usr/src/i386.i386/tmp/legacy/usr/sbin/m
ake: Undefined symbol "regcomp@FBSD_1.6"
*** Error code 1
Comment 1 ota 2021-02-21 03:13:46 UTC
I wonder if bmake can be statically linked so that install can be run on different and older systems.
Comment 2 Mark Millard 2021-02-22 07:44:41 UTC
Trying to run 13-BETA code (even installer material) on a system
that is running a 12.2-RELEASE kernel is not supported in general
as I understand: 12 does not support 13. Far more could be wrong
than just what static linking could cover.

One gnerally needs to get a 13 kernel in place and in operation
before running other 13 code on that system, as I understand.
Comment 3 Glen Barber freebsd_committer freebsd_triage 2021-02-26 17:16:57 UTC
brd@ informs this is not i386-specific
Comment 4 Glen Barber freebsd_committer freebsd_triage 2021-02-26 18:04:53 UTC
Not reproducible on releng/13.0.
Comment 5 Brad Davis freebsd_committer freebsd_triage 2021-02-26 18:14:38 UTC
Kyle, looks like this might have something to do with your change.

Note: I hit this upgrading from a recent stable/12 to stable/13.
Comment 6 Kyle Evans freebsd_committer freebsd_triage 2021-02-26 18:39:16 UTC
I'll have to crunch on this a little bit... the original report is technically an unsupported setup, bootstrap tools must be built on the earliest release you're planning on using them on.
Comment 7 ota 2021-02-27 22:06:58 UTC
(In reply to Glen Barber from comment #4)

I think you need an extra buildwolrd.

12.x or 13.x $ make buildworld buildkernel installkernel installword etc.
-- reboot + few upgrade
13.0-BETA $ make buildworld buildkernel installkernel installword etc.
-- reboot + detach /usr/{src,obj}

attach /usr/{src,obj} to 12.x
12.x $ make installkernel
-->
"regcomp@FBSD_1.6"

I see /usr/src/Makefile.inc has BPATH to usr /usr/obj/usr/src/i386.i386/tmp/legacy/usr/bin and also libraries are built unlder the tmp.

I'm wondering if we can either have LD_CONFIG to search /usr/obj/usr/src/i386.i386/tmp/legacy/lib or use linker flag, i.g, I think that's -rpath.
Comment 8 Mark Millard 2021-02-27 22:35:29 UTC
(In reply to ota from comment #7)

QUOTE (prior steps unimportant to my point)
13.0-BETA $ make buildworld buildkernel installkernel installword etc.
-- reboot + detach /usr/{src,obj}

attach /usr/{src,obj} to 12.x
12.x $ make installkernel
-->
"regcomp@FBSD_1.6"
END QUOTE

You can not use a build made by 13.0-BETA to install on
12.x . 12.x or before has to be what built the 13.0-BETA
copy that you are installing because there are programs
and libraries built and used that are executed on 12.x
in order to do the install. 13.0-BETA can not build those
in a 12.x compatible way.

This is by design for the build environment for FreeBSD:
no support of newer building to run on older, only older
building to run on older+newer.
Comment 9 ota 2021-02-27 23:09:01 UTC
Created attachment 222870 [details]
LD_LIBRARY_PATH patch

This fixed both install kernel and world.

libdialog also wasn't found via the library check.
Comment 10 ota 2021-02-27 23:12:25 UTC
(In reply to Mark Millard from comment #8)

The tmp directory contains libraries, too.
By pointing LD_LIBRARY_PATH, I was be able to run install this time.
If a new system call is introduced and used, then yes, we won't be able to depend on this, though.
Comment 11 Konstantin Belousov freebsd_committer freebsd_triage 2021-02-27 23:14:40 UTC
This is invalid configuration: you cannot run buildworld on 13-something and then
hope that it would run in 12.

There is nothing to do in the system for that.
Comment 12 ota 2021-03-02 03:39:37 UTC
per "This is invalid configuration:".