# FreeBSD 12.0 libunwind error



## bagas (May 21, 2019)

Hello.
My system FreeBSD 12.0-RELEASE-p5 amd64
Transferring jail from FreeBSD 11.2 system to FreeBSD 12.0 system.
Ports completely updated.
An error occurred while installing port libunwind.

```
root@terra:/usr/ports/devel/libunwind # make install clean

===>  Building for libunwind-20170615
Making all in src
/usr/bin/make  all-am
Making all in tests
/bin/sh ../libtool  --tag=CC    --mode=link cc  -O -pipe -march=nocona  -fstack-protector-strong -fno-strict-aliasing  -fexceptions -Wall -Wsign-compare   -fstack-protector-strong -o Gperf-simple Gperf-simple.o ../src/libunwind-x86_64.la ../src/libunwind.la
libtool: link: cc -O -pipe -march=nocona -fstack-protector-strong -fno-strict-aliasing -fexceptions -Wall -Wsign-compare -fstack-protector-strong -o .libs/Gperf-simple Gperf-simple.o  ../src/.libs/libunwind-x86_64.so /usr/ports/devel/libunwind/work/libunwind-1.2.1/src/.libs/libunwind.so ../src/.libs/libunwind.so -lgcc_s -llzma -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_init_local
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_init_local
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_local_addr_space
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_set_caching_policy
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_local_addr_space
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_set_caching_policy
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_local_addr_space
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_set_caching_policy
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_init_local
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(measure_unwind)

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_step
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(measure_unwind)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/devel/libunwind/work/libunwind-1.2.1/tests
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/devel/libunwind/work/libunwind-1.2.1
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/libunwind
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/libunwind
root@terra:/usr/ports/devel/libunwind #
```


----------



## talsamon (May 24, 2019)

See PR 219524.


----------



## bagas (May 31, 2019)

talsamon said:


> See PR 219524.


Saw.
Did not help.
This libunwind port is not going to jail d system Freebsd 12.0


----------



## Lamia (May 31, 2019)

Libunwind as another DNS tool. It is yet to withstand a test of time. 
One trick that works for me is that I try to install via pkg in order to get a list of the dependencies. I would install all via ports until ports fails, then I will use pkg to complete the job. That minimizes failure as a result of mixing ports and pkgs. No catastrophe to date.


----------



## bookwormep (Jun 26, 2019)

I have some 'libunwind' warnings shown as kernel messages at the end of each 'X' session.
Not sure if this is relevant, but here is a sample:

```
libunwind: EHHeaderParser::decodeTableEntry bad fde: CIE Id is not zero
```


----------



## mark_j (Jun 27, 2019)

According to the PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219524#c18
it is resolved when the port is updated to 1.3.1. 'distinfo' on my FreeBSD 12 says 1.2.1 is the version at present.


----------



## bookwormep (Jul 5, 2019)

Last time I looked there were about 200 pkg dependencies; I'm going to wait for the next point release
unless something REALLY crashes the box.


----------



## SirDice (Jul 8, 2019)

bookwormep said:


> Last time I looked there were about 200 pkg dependencies; I'm going to wait for the next point release
> unless something REALLY crashes the box.


All versions of FreeBSD use the exact same ports tree. In other words, third party application versions have no relation with the version of the OS.


----------



## bagas (Sep 2, 2019)

Hello.
My system FreeBSD 12.0-RELEASE-p9 amd64
Start the new jail.
Ports updated.
Install the port portupgrade-2.4.16,2
When installing ports an error, how to fix it?


```
cat /etc/make.conf

MAKE_JOBS_UNSAFE=yes



root@terra_test:/usr/ports/ports-mgmt/portupgrade # make install clean

===>  License BSD3CLAUSE accepted by the user

===>   portupgrade-2.4.16,2 depends on file: /usr/local/sbin/pkg - found

===> Fetching all distfiles required by portupgrade-2.4.16,2 for building

===>  Extracting for portupgrade-2.4.16,2

=> SHA256 Checksum OK for portupgrade/freebsd-portupgrade-2.4.16_GH0.tar.gz.

===>   portupgrade-2.4.16,2 depends on file: /usr/local/bin/ruby25 - not found

===>   ruby-2.5.5_3,1 depends on package: libffi>=0 - found

===>   ruby-2.5.5_3,1 depends on package: autoconf>=2.69 - found

===>   ruby-2.5.5_3,1 depends on package: automake>=1.16.1 - found

===>   ruby-2.5.5_3,1 depends on shared library: libyaml.so - found (/usr/local/lib/libyaml.so)

===>   ruby-2.5.5_3,1 depends on shared library: libedit.so.0 - found (/usr/local/lib/libedit.so.0)

===>   ruby-2.5.5_3,1 depends on shared library: libunwind.so - not found

===>  Building for libunwind-20170615

Making all in src

/usr/bin/make  all-am

Making all in tests

/bin/sh ../libtool  --tag=CC    --mode=link cc  -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -fexceptions -Wall -Wsign-compare   -fstack-protector-strong -o Gperf-simple Gperf-simple.o ../src/libunwind-x86_64.la ../src/libunwind.la

libtool: link: cc -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fexceptions -Wall -Wsign-compare -fstack-protector-strong -o .libs/Gperf-simple Gperf-simple.o  ../src/.libs/libunwind-x86_64.so /usr/ports/devel/libunwind/work/libunwind-1.2.1/src/.libs/libunwind.so ../src/.libs/libunwind.so -lgcc_s -llzma -Wl,-rpath -Wl,/usr/local/lib

/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_init_local

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_init_local

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_local_addr_space

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_set_caching_policy

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_local_addr_space

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_set_caching_policy

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_local_addr_space

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_set_caching_policy

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_init_local

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(measure_unwind)



/usr/bin/ld: error: cannot preempt symbol: _Ux86_64_step

>>> defined in ../src/.libs/libunwind-x86_64.so

>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(measure_unwind)

cc: error: linker command failed with exit code 1 (use -v to see invocation)

*** Error code 1



Stop.

make[7]: stopped in /usr/ports/devel/libunwind/work/libunwind-1.2.1/tests

*** Error code 1



Stop.

make[6]: stopped in /usr/ports/devel/libunwind/work/libunwind-1.2.1

*** Error code 1



Stop.

make[5]: stopped in /usr/ports/devel/libunwind

*** Error code 1



Stop.

make[4]: stopped in /usr/ports/devel/libunwind

*** Error code 1



Stop.

make[3]: stopped in /usr/ports/lang/ruby25

*** Error code 1



Stop.

make[2]: stopped in /usr/ports/lang/ruby25

*** Error code 1



Stop.

make[1]: stopped in /usr/ports/ports-mgmt/portupgrade

*** Error code 1



Stop.

make: stopped in /usr/ports/ports-mgmt/portupgrade

root@terra_test:/usr/ports/ports-mgmt/portupgrade #
```


----------



## bagas (Sep 2, 2019)

Correctly I understand that in FreeBSD 12, jail environment does not work well?
For six months the problem has not yet been resolved.
Creepy atmosphere with support!


----------



## bagas (Sep 4, 2019)

The problem is relevant.
I can not use jail in FreeBSD 12


----------



## SirDice (Sep 4, 2019)

Jails work just fine on 12.


----------



## bagas (Sep 4, 2019)

SirDice said:


> Jails work just fine on 12.


Then why can't I install some ports in jail on a FreeBSD 12 system?
I indicated the error above.


----------



## SirDice (Sep 4, 2019)

bagas said:


> Then why can't I install some ports in jail on a FreeBSD 12 system?


Most likely cause is a bad jail, wrong version or not updated correctly.


----------



## bagas (Sep 4, 2019)

The prison is right!
The prison is new.
Just collected it and launched it.
Ports are updated.
No need to shift the responsibility of errors to users of the system!
FreeBSD 12.0-RELEASE-p9 amd64


----------



## Hello Kittyhawk (Nov 20, 2019)

freebsd 12.1-stable r354366M amd64

this works for me:









						Fix libunwind build. · emaste/freebsd-ports@4857444
					

It also builds programs that try to create copy relocations of protected symbols. This applies the usual blunt fix.




					github.com


----------



## bagas (Mar 14, 2020)

Hello Kittyhawk said:


> freebsd 12.1-stable r354366M amd64
> 
> this works for me:
> 
> ...


Hello.
I tried to transfer jail from FreeBSD 11.3 to FreeBSD 12.1
Old system FreeBSD 11.3-RELEASE-p6 amd64.
New system FreeBSD 12.1-RELEASE-p2 amd64.
*added  CFLAGS+= -fPIC*

```
root@fr_test:/usr/ports/devel/libunwind # egrep -v '^$|#' Makefile
PORTNAME=    libunwind
CATEGORIES=    devel
MASTER_SITES=    SAVANNAH
DISTNAME=    ${PORTNAME}-1.2.1
MAINTAINER=    sunpoet@FreeBSD.org
COMMENT=    Generic stack unwinding library
LICENSE=    MIT
LICENSE_FILE=    ${WRKSRC}/COPYING
ONLY_FOR_ARCHS= aarch64 amd64 i386
CFLAGS+= -fPIC
OPTIONS_DEFINE=    DOCS
OPTIONS_SUB=    yes
DOCS_CONFIGURE_ON=    ac_cv_path_LATEX2MAN=${TRUE}
DOCS_CONFIGURE_OFF=    --disable-documentation
USES=        libtool pathfix pkgconfig
USE_LDCONFIG=    yes
GNU_CONFIGURE=    yes
INSTALL_TARGET=    install-strip
LLD_UNSAFE=    yes
PLIST_SUB=    ARCH=${ARCH:S|i386|x86|:S|amd64|x86_64|}
.include <bsd.port.mk>
```
error

```
root@fr_test:/usr/ports/devel/libunwind # make MAKE_JOBS_UNSAFE=yes reinstall clean
===>  Deinstalling for libunwind
===>   libunwind not installed, skipping
===>  Building for libunwind-20170615
Making all in src
/usr/bin/make  all-am
Making all in tests
/bin/sh ../libtool  --tag=CC    --mode=link cc  -O -pipe  -fstack-protector-strong -fno-strict-aliasing  -fexceptions -Wall -Wsign-compare   -fstack-protector-strong -o Gperf-simple Gperf-simple.o ../src/libunwind-x86_64.la ../src/libunwind.la
libtool: link: cc -O -pipe -fstack-protector-strong -fno-strict-aliasing -fexceptions -Wall -Wsign-compare -fstack-protector-strong -o .libs/Gperf-simple Gperf-simple.o  ../src/.libs/libunwind-x86_64.so /usr/ports/devel/libunwind/work/libunwind-1.2.1/src/.libs/libunwind.so ../src/.libs/libunwind.so -lgcc_s -llzma -Wl,-rpath -Wl,/usr/local/lib
ld: error: cannot preempt symbol: _Ux86_64_local_addr_space
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

ld: error: cannot preempt symbol: _Ux86_64_local_addr_space
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)

ld: error: cannot preempt symbol: _Ux86_64_local_addr_space
>>> defined in ../src/.libs/libunwind-x86_64.so
>>> referenced by Gperf-simple.c
>>>               Gperf-simple.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/devel/libunwind/work/libunwind-1.2.1/tests
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/devel/libunwind/work/libunwind-1.2.1
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/devel/libunwind
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/libunwind
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/libunwind
```


----------



## bagas (Mar 14, 2020)

Stability!
In my memory, the problem is exactly one year old!


----------



## mark_j (Mar 14, 2020)

I just built it on freebsd 12.1-RELEASE-p1 FreeBSD 12.1-RELEASE-p1 .
Remove lld_unsafe.


----------



## bagas (Mar 15, 2020)

What to delete?
Remove lld_unsafe.


----------

