Bug 775

Summary: compile error with custom libselinux header files
Product: Busybox Reporter: nospam+busybox
Component: OtherAssignee: unassigned
Status: RESOLVED WORKSFORME    
Severity: minor CC: busybox-cvs
Priority: P4    
Version: 1.15.x   
Target Milestone: ---   
Hardware: All   
OS: All   
Host: Target:
Build:
Attachments: .config generated by 'make menuconfig'

Description nospam+busybox 2009-12-04 03:44:20 UTC
On the latest stable release of BusyBox, there is a potential error when compiling applet_tables.c.  If SELinux is enabled and the libselinux header files are not in a standard location (e.g., /usr/include), those header files will not be found as part of the #include of libbb.h.  The compile command (as evidenced by running make V=1) ignores attempts at passing a -I flag, either through CFLAGS or EXTRA_CFLAGS.  The only solution I could find was to edit libbb.h and use fully-qualified pathnames to those libselinux header files.
Comment 1 Denys Vlasenko 2009-12-04 12:54:43 UTC
Please attach your .config
Comment 2 nospam+busybox 2009-12-10 02:30:43 UTC
Created attachment 815 [details]
.config generated by 'make menuconfig'

(File renamed to just config because firefox will not let me attach something called .config.)
Comment 3 Denys Vlasenko 2010-06-04 10:07:16 UTC
I moved errno.h to /tmp. Confirmed that build fails now.
Then added

I added CONFIG_EXTRA_CFLAGS="-I/tmp"

to my .config, then ran "make V=1" and it works:

...
make -f scripts/Makefile.build obj=archival/libunarchive
  i486-linux-uclibc-gcc -Wp,-MD,archival/libunarchive/.data_align.o.d   -std=gnu99 -Iinclude -Ilibbb  -include include/autoconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D"BB_VER=KBUILD_STR(1.17.0.git)" -DBB_BT=AUTOCONF_TIMESTAMP  -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Werror -Wold-style-definition -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -Os -I/tmp -march=i386 -mpreferred-stack-boundary=2    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(data_align)"  -D"KBUILD_MODNAME=KBUILD_STR(data_align)" -c -o archival/libunarchive/data_align.o archival/libunarchive/data_align.c
...

Note -I/tmp in the command above.

Thus, it works for me. What make V=1 shows for you - do you see -I/home/burdell/target/usr/include in commands? What is the error message you are getting?
Comment 4 Denys Vlasenko 2010-08-11 22:28:01 UTC
Closing, assuming reporter was able to make it work on his side.