New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling on musl system #582
Comments
Dear FallingSnow to get the missing file you can try to install a 3rd party package that contains it, like: |
I know, but it's the system I have :( $ apk list --installed | grep syslinux
syslinux-dev-6.04_pre1-r9 x86_64 {syslinux} (GPL-2.0-or-later) [installed]
$ ls /usr/share/syslinux/com32/include/sys/pci.h -l
-rw-r--r-- 1 root root 4299 Apr 13 2021 /usr/share/syslinux/com32/include/sys/pci.h I tried that earlier when I found it via https://pkgs.alpinelinux.org/contents?file=pci.h&path=*%2Fsys&name=&branch=v3.15&arch=x86_64. Maybe my includes are wrong? |
did you add the installation path to your $PATH variables so the compiler #include can see it? |
I tried adding it to PATH $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/share/syslinux
$ git clone --depth=1 https://github.com/Mellanox/mstflint.git
...
$ cd mstflint
$ ./autogen.sh
...
$ ./configure --disable-inband
...
$ make -j24
...
mtcr_ul_com.c:80:10: fatal error: sys/pci.h: No such file or directory
80 | #include <sys/pci.h>
| ^~~~~~~~~~~
compilation terminated. Same error. |
These were the only changes I needed to make to compile on musl (after installing diff -ur mstflint-4.20.0-orig/mtcr_ul/mtcr_ul_com.c mstflint-4.20.0/mtcr_ul/mtcr_ul_com.c
--- mstflint-4.20.0-orig/mtcr_ul/mtcr_ul_com.c 2022-04-28 11:50:04.000000000 +0000
+++ mstflint-4.20.0/mtcr_ul/mtcr_ul_com.c 2022-05-19 14:06:49.479797274 +0000
@@ -67,7 +67,13 @@
#include <endian.h>
#include <byteswap.h>
#include <errno.h>
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
#include <sys/types.h>
+#undef _GNU_SOURCE
+#else
+#include <sys/types.h>
+#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
@@ -77,7 +83,7 @@
#if CONFIG_ENABLE_MMAP
#include <sys/mman.h>
-#include <sys/pci.h>
+#include <linux/pci.h>
#include <sys/ioctl.h>
#endif |
@acaos That worked perfectly. Thank you! |
Running into an issue on alpine linux. Can't seem to find
sys/pci.h
while compiling. Cloned from master branch.See https://bugs.gentoo.org/713610 for additional info.
$ uname -a Linux master1.node.universalis.dev 5.15.37-0-lts #1-Alpine SMP Tue, 03 May 2022 11:42:03 +0000 x86_64 Linux $ git rev-parse origin/master 5b34f7a86d0b5862b0e6d5cfaf06869a85b466cb
The text was updated successfully, but these errors were encountered: