New: CMake-based host package fails to include output/host/include
https://bugs.busybox.net/show_bug.cgi?id=12391
Bug ID: 12391
Summary: CMake-based host package fails to include
output/host/include
Product: buildroot
Version: 2019.08.1
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: thirtythreeforty at gmail.com
CC: buildroot at uclibc.org
Target Milestone: ---
Created attachment 8311
--> https://bugs.busybox.net/attachment.cgi?id=8311&action=edit
Work-in-progress package to replicate the issue
I am struggling to package a new version of mfgtools. My work-in-progress is attached; ideally you can extract this into your working directory and replicate my error.
mfgtools depends on bzlib.h while building. The compiler (/usr/bin/gcc) cannot find the bzlib.h file, which at first doesn't make sense... it's in output/host/include where bzip2 puts it.
/home/ghilliard/Code/buildroot/output/build/host-mfgtools-1.3.102/libuuu/buffer.cpp:43:10:
fatal error: bzlib.h: No such file or directory
#include "bzlib.h"
^~~~~~~~~The problem is that even though Buildroot passes -Imy/buildroot/output/host/include into CMake, CMake detects this as an "implicit include directory" because GCC reports it as such (I think GCC notices that it has "system" include files, but honestly I am not exactly sure about its logic). Then, when the compiler is actually called, this include is omitted by CMake. Without the include, the compiler doesn't implicitly include the directory at all, and the build fails.
This hasn't been hit before because there are no bzip2-dependant host packages in the tree that are built with CMake. I do not think this is specific to mfgtools; rather, it will be hit by the first package that does all of the following:
- Be a host package
- Use CMake to build
- Include a file in output/host/include, not one of its subdirectories
Signature · 2 lines
You are receiving this mail because: You are on the CC list for the bug.
[Buildroot] [Bug 12391] CMake-based host package fails to include output/host/include
https://bugs.busybox.net/show_bug.cgi?id=12391
Thomas Petazzoni <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WONTFIX--- Comment #1 from Thomas Petazzoni <[email protected]> --- Thanks for your bug report.
However, it is really the mfgtools code that is broken: in libuuu/CMakeLists.txt it overwrites CMAKE_CXX_FLAGS, which means it ignores the value Buildroot is passing, which contains -I$(HOST_DIR)/include.
If you change:
libuuu/CMakeLists.txt:set(CMAKE_CXX_FLAGS "-O2 ${UUUSSL}")
to:
libuuu/CMakeLists.txt:set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 ${UUUSSL}")
suddenly, it will work.
Signature · 2 lines
You are receiving this mail because: You are on the CC list for the bug.
[Buildroot] [Bug 12391] CMake-based host package fails to include output/host/include
In reply to bugzilla at busybox.nethttps://bugs.busybox.net/show_bug.cgi?id=12391
--- Comment #2 from Fabrice Fontaine <[email protected]> --- FYI, I sent the fix suggested by Thomas and it was merged upstream:
https://github.com/NXPmicro/mfgtools/commit/ea8eb862ce2445c17bb8dd55587d6a2581d20b68
Signature · 2 lines
You are receiving this mail because: You are on the CC list for the bug.