[GH-ISSUE #999] Fails to build with mtune=native (haswell), or -O3 #679

Closed
opened 2026-05-05 06:26:00 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @0xBRM on GitHub (Dec 23, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/999

λ desktop firejail → λ git master → make CFLAGS="-march=native -mtune=haswell"
make -C src/lib
make[1]: Entering directory '/home/desktop/git-projects/firejail/src/lib'
cc -march=native -mtune=haswell  -c common.c -o common.o
cc -march=native -mtune=haswell  -c libnetlink.c -o libnetlink.o
cc -march=native -mtune=haswell  -c pid.c -o pid.o
make[1]: Leaving directory '/home/desktop/git-projects/firejail/src/lib'
make -C src/firejail
make[1]: Entering directory '/home/desktop/git-projects/firejail/src/firejail'
cc -march=native -mtune=haswell  -c appimage.c -o appimage.o
cc -march=native -mtune=haswell  -c appimage_size.c -o appimage_size.o
cc -march=native -mtune=haswell  -c arp.c -o arp.o
cc -march=native -mtune=haswell  -c bandwidth.c -o bandwidth.o
bandwidth.c: In function ‘bandwidth_pid’:
bandwidth.c:411:5: error: ‘LIBDIR’ undeclared (first use in this function)
     LIBDIR, command, devname, down, up) == -1)
     ^~~~~~
bandwidth.c:411:5: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [Makefile:35: bandwidth.o] Error 1
make[1]: Leaving directory '/home/desktop/git-projects/firejail/src/firejail'
make: *** [Makefile:32: src/firejail] Error 2

Compiles normally otherwise. Also fails if you remove mtune and march and add -O3, with the exact same error.

gcc is 6.2.0.

Originally created by @0xBRM on GitHub (Dec 23, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/999 ```bash λ desktop firejail → λ git master → make CFLAGS="-march=native -mtune=haswell" make -C src/lib make[1]: Entering directory '/home/desktop/git-projects/firejail/src/lib' cc -march=native -mtune=haswell -c common.c -o common.o cc -march=native -mtune=haswell -c libnetlink.c -o libnetlink.o cc -march=native -mtune=haswell -c pid.c -o pid.o make[1]: Leaving directory '/home/desktop/git-projects/firejail/src/lib' make -C src/firejail make[1]: Entering directory '/home/desktop/git-projects/firejail/src/firejail' cc -march=native -mtune=haswell -c appimage.c -o appimage.o cc -march=native -mtune=haswell -c appimage_size.c -o appimage_size.o cc -march=native -mtune=haswell -c arp.c -o arp.o cc -march=native -mtune=haswell -c bandwidth.c -o bandwidth.o bandwidth.c: In function ‘bandwidth_pid’: bandwidth.c:411:5: error: ‘LIBDIR’ undeclared (first use in this function) LIBDIR, command, devname, down, up) == -1) ^~~~~~ bandwidth.c:411:5: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [Makefile:35: bandwidth.o] Error 1 make[1]: Leaving directory '/home/desktop/git-projects/firejail/src/firejail' make: *** [Makefile:32: src/firejail] Error 2 ``` Compiles normally otherwise. Also fails if you remove mtune and march and add -O3, with the exact same error. gcc is 6.2.0.
Author
Owner

@reinerh commented on GitHub (Dec 24, 2016):

That's because you are overriding the CFLAGS set in the Makefile.
Try something like: CFLAGS="-march=native" make

<!-- gh-comment-id:269087846 --> @reinerh commented on GitHub (Dec 24, 2016): That's because you are overriding the CFLAGS set in the Makefile. Try something like: CFLAGS="-march=native" make
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#679
No description provided.