# Is the port of pkg broken?



## HL1234 (Aug 30, 2019)

Hello,
Is the port of ports-mgmt/pkgbroken? I get this error:

/usr/ports/ports-mgmt/pkg# `make`

`make clean`
`make`
doesn't help


```
[# /usr/ports/ports-mgmt/pkg => make
===>  Staging for pkg-1.11.1
===>   Generating temporary packing list
install -d -m 755 /usr/ports/ports-mgmt/pkg/work/stage/usr/local/lib
install -d -m 755 /usr/ports/ports-mgmt/pkg/work/stage/usr/local/include
install -d -m 755 /usr/ports/ports-mgmt/pkg/work/stage/usr/local/libdata/pkgconfig
install -s -m 644 libpkg.so.4 /usr/ports/ports-mgmt/pkg/work/stage/usr/local/lib/
ln -sf libpkg.so.4 /usr/ports/ports-mgmt/pkg/work/stage/usr/local/lib/libpkg.so
install -s -m 644 libpkg.a /usr/ports/ports-mgmt/pkg/work/stage/usr/local/lib/
install -m 644 pkg.h /usr/ports/ports-mgmt/pkg/work/stage/usr/local/include/
install -m 644 pkg.pc /usr/ports/ports-mgmt/pkg/work/stage/usr/local/libdata/pkgconfig
install -d -m 755 /usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin
install -s -m 755 pkg-static /usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static
strip: /usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static symbol number 7677 references nonexistent SHT_SYMTAB_SHNDX section
strip:/usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static: file in wrong format
install: strip command strip failed on /usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static
*** Error code 70

Stop.
make[4]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.11.1/src
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.11.1
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make: stopped in /usr/ports/ports-mgmt/pkg
```


----------



## SirDice (Aug 30, 2019)

What's in /etc/make.conf? And what version of FreeBSD?


----------



## olli@ (Aug 30, 2019)

Support for SHT_SYMTAB_SHNDX was added to LLVM just recently(*), if I recall correctly. So I assume your FreeBSD version is too old.
The pkg port works fine for me, I've just updated it (running on FreeBSD stable/12 amd64).

(*) About one year ago.


----------



## HL1234 (Aug 30, 2019)

sorry for the late answer:
`uname -a`
FreeBSD svman.de 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 r344230 VSERVER_KERNEL  amd64
in make.conf I have nothing new. And for some month I got no problems with the port pkg
here are some entries:


> CC=clang
> CXX=clang++
> CPP=clang-cpp
> CPUTYPE?=native
> ...


I have renamed make.conf and try again but get the same error.
I will examine this


> strip: /usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static symbol number 7677 references nonexistent SHT_SYMTAB_SHNDX section
> strip:/usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static: file in wrong format


----------



## HL1234 (Aug 30, 2019)

> trip: /usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static symbol number 7677 references nonexistent SHT_SYMTAB_SHNDX section
> strip:/usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static: file in wrong format


# `ls -l /usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static`
ls: /usr/ports/ports-mgmt/pkg/work/stage/usr/local/sbin/pkg-static: No such file or directory

files doesn't exist?
I find out: `make build`is working `make install` not. 
I see to places where pkg live a) in /usr/sbin/pkg and b) /usr/local/sbin/pkg. Does the port install in both places?


----------



## zirias@ (Aug 31, 2019)

HL1234 said:


> make.conf [...]
> here are some entries:
> 
> ```
> ...


Ok, so it's unlikely (but not entirely impossible) that your make.conf caused this problem. Still, *why?* Trying to "optimize" in make.conf has (very close to) no effect at all, except for serving as a source of weird problems. And I completely fail to see the reason behind resetting all these variables CC, CXX, ... to what _should_ effectively be the same as make's default. Except when, for some strange reason, it isn't any more ...


----------



## olli@ (Sep 2, 2019)

HL1234 said:


> `uname -a`
> FreeBSD svman.de 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 r344230 VSERVER_KERNEL  amd64
> in make.conf I have nothing new. And for some month I got no problems with the port pkg
> here are some entries:
> ...


All of those entries do _not_ belong in make.conf and _will_ cause breakage sooner or later. If you have already build parts of your system with those entries, that might explain the weird behavior.


----------

