#46 pkg-config not working on ARM 32bit
Closed: not a bug by pbrobinson. Opened by mrfusion.

I trying to compile something on my Raspberry Pi 2 using Fedora IoT 32bit, but pkg-config from the base image doesn't work. Calling it yields:

pkg-config /usr/bin/pkg-config: line 8: /usr/bin/armv7hnl-redhat-linux-gnueabi-pkg-config: No such file or directory

The files prefixed with arm in /usr/bin/ are:

ls -l /usr/bin/armv*
-rwxr-xr-x. 7 root root 1127432 Jan  1  1970 /usr/bin/armv7hl-redhat-linux-gnueabi-gcc
-rwxr-xr-x. 7 root root 1127432 Jan  1  1970 /usr/bin/armv7hl-redhat-linux-gnueabi-gcc-10
-rwxr-xr-x. 3 root root     822 Jan  1  1970 /usr/bin/armv7hl-redhat-linux-gnueabi-pkg-config

So the difference is armv7hnl vs armv7hl.

# uname -a
Linux mytesthost 5.10.22-200.fc33.armv7hl #1 SMP Tue Mar 9 22:59:18 UTC 2021 armv7l armv7l armv7l GNU/Linux
# rpm --eval '%{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}'
armv7hnl-redhat-linux-gnueabi

the 'n' in armv7hnl is for NEON optimisation. This is how you're setting up you're CFLAGS and nothing to do with IoT (or likely even Fedora arm)

Metadata Update from @pbrobinson:
- Issue close_status updated to: not a bug
- Issue status updated to: Closed (was: Open)

Shouldn't just calling pkg-config somepackage from the command line work?

Originally, I wanted to compile something in Rust with Cargo which needs C flags and calls:

  --- stderr
  thread 'main' panicked at 'Pkg-config failed - usually this is because alsa development headers are not installed.
  For Fedora users:
  # dnf install alsa-lib-devel
  For Debian/Ubuntu users:
  # apt-get install libasound2-dev
  pkg_config details:
  `"pkg-config" "--libs" "--cflags" "alsa"` did not exit successfully: exit code: 127
  --- stderr
  /usr/bin/pkg-config: line 8: /usr/bin/armv7hnl-redhat-linux-gnueabi-pkg-config: No such file or directory
  ', /var/home/user/.cargo/registry/src/github.com-1285ae84e5963aae/alsa-sys-0.3.1/build.rs:6:50

Just to be clear: This is NOT cross-compiling.

I am no expert in compiling and don't know what to do, i would just expect it to work.

Metadata Update from @mrfusion:
- Issue status updated to: Open (was: Closed)

Well arm builds work for me, I don't do them on IoT edition, but i do them basically daily on Fedora arm, and we do 100s a day on the build infrastructure.

Doing builds on a ostree platform is likely not the best way, you should likely use a container on top or something.

The compilers work just fine, but you've not outlined what you've installed, how you're trying to do it or or basically anything, and this isn't really the place to file build issues.

Metadata Update from @pbrobinson:
- Issue close_status updated to: not a bug
- Issue status updated to: Closed (was: Open)

Metadata