Skip to content

Instantly share code, notes, and snippets.

@kodo-pp
Created July 2, 2019 23:36
Show Gist options
  • Save kodo-pp/adc76f884e4a266920b338378b231403 to your computer and use it in GitHub Desktop.
Save kodo-pp/adc76f884e4a266920b338378b231403 to your computer and use it in GitHub Desktop.
~/tmp $ pacman -Qi libelfin-git # OK, Package not installed
error: package 'libelfin-git' was not found
~/tmp $ pkg-config --libs --cflags libelf++ # OK, Package not installed, so libelf++.pc does not exist yet
Package libelf++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `libelf++.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libelf++', required by 'virtual:world', not found
~/tmp $ # Install libelfin-git package (quite a large piece of terminal transcript; notice makepkg WARNING on line 100 and sed command on line 90)
~/tmp $ git clone https://aur.archlinux.org/libelfin-git
Cloning into 'libelfin-git'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9 (delta 2), reused 9 (delta 2)
Unpacking objects: 100% (9/9), done.
~/tmp $ cd libelfin-git
~/tmp/libelfin-git $ ls
PKGBUILD
~/tmp/libelfin-git $ makepkg -i
==> Making package: libelfin-git r148.ac45a09-1 (Wed 03 Jul 2019 02:23:12 AM MSK)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Cloning libelfin-git git repo...
Cloning into bare repository '/home/kodopp/tmp/libelfin-git/libelfin-git'...
remote: Enumerating objects: 975, done.
remote: Total 975 (delta 0), reused 0 (delta 0), pack-reused 975
Receiving objects: 100% (975/975), 215.08 KiB | 884.00 KiB/s, done.
Resolving deltas: 100% (592/592), done.
==> Validating source files with sha256sums...
libelfin-git ... Skipped
==> Extracting sources...
-> Creating working copy of libelfin-git git repo...
Cloning into 'libelfin-git'...
done.
==> Starting pkgver()...
==> Starting build()...
make -C elf
make[1]: Entering directory '/home/kodopp/tmp/libelfin-git/src/libelfin-git/elf'
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o elf.o elf.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o mmap_loader.o mmap_loader.cc
python3 enum-print.py -u --hex --no-type --mask shf --mask pf \
-x loos -x hios -x loproc -x hiproc < data.hh >> to_string.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o to_string.o to_string.cc
ar rcs libelf++.a elf.o mmap_loader.o to_string.o
ln -s libelf++.so.0 libelf++.so
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared -Wl,-soname,libelf++.so.0 -o libelf++.so.0 elf.o mmap_loader.o to_string.o
make[1]: Leaving directory '/home/kodopp/tmp/libelfin-git/src/libelfin-git/elf'
make -C dwarf
make[1]: Entering directory '/home/kodopp/tmp/libelfin-git/src/libelfin-git/dwarf'
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o dwarf.o dwarf.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o cursor.o cursor.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o die.o die.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o value.o value.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o abbrev.o abbrev.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o expr.o expr.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o rangelist.o rangelist.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o line.o line.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o attrs.o attrs.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o die_str_map.o die_str_map.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o elf.o elf.cc
python3 ../elf/enum-print.py < dwarf++.hh >> to_string.cc
python3 ../elf/enum-print.py -s _ -u --hex -x hi_user -x lo_user < data.hh >> to_string.cc
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -D_FORTIFY_SOURCE=2 -c -o to_string.o to_string.cc
ar rcs libdwarf++.a dwarf.o cursor.o die.o value.o abbrev.o expr.o rangelist.o line.o attrs.o die_str_map.o elf.o to_string.o
g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -O2 -Werror -std=c++0x -Wall -fPIC -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -shared -Wl,-soname,libdwarf++.so.0 -o libdwarf++.so.0 dwarf.o cursor.o die.o value.o abbrev.o expr.o rangelist.o line.o attrs.o die_str_map.o elf.o to_string.o
ln -s libdwarf++.so.0 libdwarf++.so
make[1]: Leaving directory '/home/kodopp/tmp/libelfin-git/src/libelfin-git/dwarf'
==> Entering fakeroot environment...
==> Starting package()...
make -C elf install
make[1]: Entering directory '/home/kodopp/tmp/libelfin-git/src/libelfin-git/elf'
install -d /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib/pkgconfig
install -t /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib libelf++.a
install -t /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib libelf++.so.0
install -t /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib libelf++.so
install -d /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/include/libelfin/elf
install -t /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/include/libelfin/elf common.hh data.hh elf++.hh
sed 's,^libdir=.*,libdir=/home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib,;s,^includedir=.*,includedir=/home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/include,' libelf++.pc \
> /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib/pkgconfig/libelf++.pc
make[1]: Leaving directory '/home/kodopp/tmp/libelfin-git/src/libelfin-git/elf'
make -C dwarf install
make[1]: Entering directory '/home/kodopp/tmp/libelfin-git/src/libelfin-git/dwarf'
install -d /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib/pkgconfig
install -t /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib libdwarf++.a
install -t /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib libdwarf++.so.0
install -t /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib libdwarf++.so
install -d /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/include/libelfin/dwarf
install -t /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/include/libelfin/dwarf data.hh dwarf++.hh small_vector.hh
sed 's,^libdir=.*,libdir=/home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib,;s,^includedir=.*,includedir=/home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/include,' libdwarf++.pc \
> /home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib/pkgconfig/libdwarf++.pc
make[1]: Leaving directory '/home/kodopp/tmp/libelfin-git/src/libelfin-git/dwarf'
==> Tidying install...
-> Removing libtool files...
-> Purging unwanted files...
-> Removing static library files...
-> Stripping unneeded symbols from binaries and libraries...
-> Compressing man and info pages...
==> Checking for packaging issues...
==> WARNING: Package contains reference to $pkgdir
usr/lib/pkgconfig/libdwarf++.pc
usr/lib/pkgconfig/libelf++.pc
==> Creating package "libelfin-git"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
mount: only root can use "--options" option
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: libelfin-git r148.ac45a09-1 (Wed 03 Jul 2019 02:23:32 AM MSK)
==> Installing package libelfin-git with pacman -U...
-- Remount /boot RW --
loading packages...
resolving dependencies...
looking for conflicting packages...
Packages (1) libelfin-git-r148.ac45a09-1
Total Installed Size: 0.64 MiB
:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [########################################################################################] 100%
(1/1) checking package integrity [########################################################################################] 100%
(1/1) loading package files [########################################################################################] 100%
(1/1) checking for file conflicts [########################################################################################] 100%
(1/1) checking available disk space [########################################################################################] 100%
:: Processing package changes...
(1/1) installing libelfin-git [########################################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
-- Remount /boot RO --
~/tmp/libelfin-git $ # Now, the package is installed
~/tmp/libelfin-git $ # Let's check pkg-config
~/tmp/libelfin-git $ pkg-config --libs --cflags libelf++
-I/home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/include -L/home/kodopp/tmp/libelfin-git/pkg/libelfin-git/usr/lib -lelf++
~/tmp/libelfin-git $ # Expected behavior: outputs something like -I/usr/include -L/usr/lib -lelf++
~/tmp/libelfin-git $ # Actual behaviour: outputs paths to usr/include and usr/lib inside the build directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment