Compiling with libboost on raspberry pi - undefined reference to `boost::system::system_category() - linux

I'm trying to compile Ocelot tracker on raspberry pi 2 with OS Raspbian Jessie. I have installed libboost1.55-dev-all libraries from apt.
When compiling I get multiple errors : "undefined reference to `boost::system::system_category()".
I've been searching a lot and I found out that in most cases this is a problem with linker and something like -lboost_system should be put somewhere in the Makefile.am, but I'm not sure where to put it.
Also I'm not even sure this is the case here. Any pointer would be much appreciated, this is the first time I'm doing anything like this.
The complete log when compiling:
pi#raspberrypi:~/ocelot-1.0 $ make
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT config.o -MD -MP -MF .deps/config.Tpo -c -o config.o config.cpp
mv -f .deps/config.Tpo .deps/config.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT db.o -MD -MP -MF .deps/db.Tpo -c -o db.o db.cpp
mv -f .deps/db.Tpo .deps/db.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT events.o -MD -MP -MF .deps/events.Tpo -c -o events.o events.cpp
mv -f .deps/events.Tpo .deps/events.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT misc_functions.o -MD -MP -MF .deps/misc_functions.Tpo -c -o misc_functions.o misc_functions.cpp
mv -f .deps/misc_functions.Tpo .deps/misc_functions.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT ocelot.o -MD -MP -MF .deps/ocelot.Tpo -c -o ocelot.o ocelot.cpp
mv -f .deps/ocelot.Tpo .deps/ocelot.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT report.o -MD -MP -MF .deps/report.Tpo -c -o report.o report.cpp
mv -f .deps/report.Tpo .deps/report.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT response.o -MD -MP -MF .deps/response.Tpo -c -o response.o response.cpp
mv -f .deps/response.Tpo .deps/response.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT schedule.o -MD -MP -MF .deps/schedule.Tpo -c -o schedule.o schedule.cpp
mv -f .deps/schedule.Tpo .deps/schedule.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT site_comm.o -MD -MP -MF .deps/site_comm.Tpo -c -o site_comm.o site_comm.cpp
mv -f .deps/site_comm.Tpo .deps/site_comm.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT user.o -MD -MP -MF .deps/user.Tpo -c -o user.o user.cpp
mv -f .deps/user.Tpo .deps/user.Po
g++ -DPACKAGE_NAME=\"ocelot\" -DPACKAGE_TARNAME=\"ocelot\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"ocelot\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DHAVE_BOOST_IOSTREAMS=/\*\*/ -DHAVE_BOOST_SYSTEM=/\*\*/ -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBTCMALLOC=1 -I. -I/usr/include -I/usr/include/mysql -I/usr/include/mysql++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -MT worker.o -MD -MP -MF .deps/worker.Tpo -c -o worker.o worker.cpp
worker.cpp: In member function ‘void worker::reap_peers()’:
worker.cpp:1028:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (p->second.last_announced + peers_timeout < cur_time) {
^
worker.cpp:1041:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (p->second.last_announced + peers_timeout < cur_time) {
^
mv -f .deps/worker.Tpo .deps/worker.Po
g++ -std=c++11 -march=native -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors -pthread -I/usr/include -fstack-protector-strong -g -O2 -Wl,-O1 -Wl,--as-needed -L/usr/lib/arm-linux-gnueabihf/ -L/usr/lib/arm-linux-gnueabihf/ -o ocelot config.o db.o events.o misc_functions.o ocelot.o report.o response.o schedule.o site_comm.o user.o worker.o -lboost_iostreams -ltcmalloc -lmysqlpp -lmysqlclient -lev
site_comm.o: In function `error_code':
/usr/include/boost/system/error_code.hpp:323: undefined reference to `boost::system::system_category()'
/usr/include/boost/system/error_code.hpp:323: undefined reference to `boost::system::system_category()'
/usr/include/boost/system/error_code.hpp:323: undefined reference to `boost::system::system_category()'
/usr/include/boost/system/error_code.hpp:323: undefined reference to `boost::system::system_category()'
site_comm.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:224: undefined reference to `boost::system::system_category()'
site_comm.o:/usr/include/boost/system/error_code.hpp:323: more undefined references to `boost::system::system_category()' follow
site_comm.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:224: undefined reference to `boost::system::system_category()'
site_comm.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:224: undefined reference to `boost::system::system_category()'
events.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:224: undefined reference to `boost::system::system_category()'
events.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:224: undefined reference to `boost::system::system_category()'
events.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:224: undefined reference to `boost::system::system_category()'
ocelot.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:224: undefined reference to `boost::system::system_category()'
ocelot.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:224: undefined reference to `boost::system::system_category()'
schedule.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:224: undefined reference to `boost::system::system_category()'
schedule.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:224: undefined reference to `boost::system::system_category()'
worker.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:223: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:224: undefined reference to `boost::system::system_category()'
worker.o: In function `get_system_category':
/usr/include/boost/asio/error.hpp:224: undefined reference to `boost::system::system_category()'
collect2: error: ld returned 1 exit status
Makefile:412: recipe for target 'ocelot' failed
make: *** [ocelot] Error 1
Original Makefile.am
ACLOCAL_AMFLAGS = -I m4
bin_PROGRAMS = ocelot ocelot_SOURCES = config.cpp config.h db.cpp db.h events.cpp events.h misc_functions.cpp misc_functions.h \
ocelot.cpp ocelot.h report.cpp report.h response.cpp response.h \
schedule.cpp schedule.h site_comm.cpp site_comm.h user.cpp user.h worker.cpp worker.h
AM_CXXFLAGS = -std=c++11 -march=native -O2 -fvisibility=hidden
-fvisibility-inlines-hidden -fomit-frame-pointer -fno-ident -Wall -Wfatal-errors $(PTHREAD_CFLAGS) $($ ocelot_LDADD = $(PTHREAD_LIBS) $(BOOST_IOSTREAMS_LIB) $(BOOST_SYSTEM_LIB) AM_LDFLAGS = -Wl,-O1
-Wl,--as-needed EXTRA_DIST = CHANGES LICENSE README.md ocelot.conf.dist dist-hook:
touch ${distdir}/configure
patch -p2 -d ${distdir} --no-backup-if-mismatch < ../dist.patch

Boost-related files in m4 folder may be too old, new versions can be downloaded from boost base, boost iostreams, and boost system.
After copying new versions of the files to folder m4, try autoreconf -fvi and then configure and make.
I managed to compile ocelot on debian jessie amd64 after updating those m4 files.

Related

Systemd fails to compile on arm environment

Im trying to compile systemd in a qemu chroot environment.
The environment is built with cross compiler and using gcc 11.2.
I have tried with systemd 249, 247 and 246.
They all gives the same error.
meson is succeeded and the options is:
meson --prefix=/usr --sysconfdir=/etc --localstatedir=/var --buildtype=release -Dblkid=true -Ddefault-dnssec=no -Dfirstboot=false -Dinstall-tests=false -Dldconfig=false -Dman=false -Dsysusers=false -Drpmmacrosdir=no -Db_lto=false -Dhomed=false -Duserdb=false -Dmode=release -Dpamconfdir=/etc/pam.d -Defi=false -Dgnu-efi=false -Dtpm=false
When running ninja it complains about assert.
Here are some of the failed:
[13/1524] Compiling C object src/udev/ata_id.p/ata_id_ata_id.c.o
FAILED: src/udev/ata_id.p/ata_id_ata_id.c.o
cc -Isrc/udev/ata_id.p -Isrc/udev -I../src/udev -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I. -I.. -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -O3 -Wno-format-signedness -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-result -Wdate-time -Wendif-labels -Werror=format=2 -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=overflow -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wwrite-strings -Wno-maybe-uninitialized -Werror=missing-declarations -Werror=missing-prototypes -fdiagnostics-show-option -ffast-math -fno-common -fno-strict-aliasing -fstack-protector -fstack-protector-strong -fvisibility=hidden --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -MD -MQ src/udev/ata_id.p/ata_id_ata_id.c.o -MF src/udev/ata_id.p/ata_id_ata_id.c.o.d -o src/udev/ata_id.p/ata_id_ata_id.c.o -c ../src/udev/ata_id/ata_id.c
In file included from ../src/basic/macro.h:4,
from ../src/basic/fd-util.h:9,
from ../src/udev/ata_id/ata_id.c:27:
../src/fundamental/macro-fundamental.h:38:9: error: static assertion failed: "STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1"
38 | static_assert(expr, #expr)
| ^~~~~~~~~~~~~
../src/basic/log.h:65:1: note: in expansion of macro 'assert_cc'
65 | assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1)
| ^~~~~~~~~
[14/1524] Compiling C object src/core/libcore.a.p/dbus-device.c.o
FAILED: src/core/libcore.a.p/dbus-device.c.o
cc -Isrc/core/libcore.a.p -Isrc/core -I../src/core -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I. -I.. -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -I/usr/include/libmount -I/usr/include/blkid -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -O3 -Wno-format-signedness -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-result -Wdate-time -Wendif-labels -Werror=format=2 -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=overflow -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wwrite-strings -Wno-maybe-uninitialized -Werror=missing-declarations -Werror=missing-prototypes -fdiagnostics-show-option -ffast-math -fno-common -fno-strict-aliasing -fstack-protector -fstack-protector-strong -fvisibility=hidden --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -fPIC -pthread -MD -MQ src/core/libcore.a.p/dbus-device.c.o -MF src/core/libcore.a.p/dbus-device.c.o.d -o src/core/libcore.a.p/dbus-device.c.o -c ../src/core/dbus-device.c
In file included from ../src/basic/macro.h:4,
from ../src/basic/alloc-util.h:9,
from ../src/basic/hash-funcs.h:4,
from ../src/basic/hashmap.h:8,
from ../src/shared/fdset.h:6,
from ../src/shared/bpf-program.h:9,
from ../src/core/unit.h:10,
from ../src/core/device.h:4,
from ../src/core/dbus-device.c:4:
../src/fundamental/macro-fundamental.h:38:9: error: static assertion failed: "STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1"
38 | static_assert(expr, #expr)
| ^~~~~~~~~~~~~
../src/basic/log.h:65:1: note: in expansion of macro 'assert_cc'
65 | assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1);
| ^~~~~~~~~\
[9/1511] Compiling C object src/libsystemd/libsystemd_static.a.p/sd-bus_bus-creds.c.o
FAILED: src/libsystemd/libsystemd_static.a.p/sd-bus_bus-creds.c.o
cc -Isrc/libsystemd/libsystemd_static.a.p -Isrc/libsystemd -I../src/libsystemd -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I. -I.. -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event
-I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99
-O3 -Wno-format-signedness -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-result -Wdate-time -Wendif-labels -Werror=format=2 -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=overflow -Werror=return-type -Werror=shift-c
ount-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict
-prototypes -Wsuggest-attribute=noreturn -Wwrite-strings -Wno-maybe-uninitialized -Werror=missing-declarations -Werror=missing-prototypes -fdiagnostics-show-option -ffast-math -fno-common -fno-strict-aliasing -fstack-protector -fstack-protector-strong -fvisibility=hidde
n --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -fPIC -pthread -fvisibility=default -MD -MQ src/libsystemd/libsystemd_static.a.p/sd-bus_bus-creds.c.o -MF src/libsystemd/libsystemd_static.a.p/sd-bus_bus-creds.c.o.d -o src/
libsystemd/libsystemd_static.a.p/sd-bus_bus-creds.c.o -c ../src/libsystemd/sd-bus/bus-creds.c
In file included from ../src/basic/macro.h:11,
from ../src/basic/alloc-util.h:9,
from ../src/libsystemd/sd-bus/bus-creds.c:6:
../src/fundamental/macro-fundamental.h:42:22: error: size of array 'x' is negative
42 | char x[(expr) ? 0 : -1]; \
| ^
../src/basic/log.h:65:1: note: in expansion of macro 'assert_cc'
65 | assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1);
| ^~~~~~~~~
Im not very experienced in cross compiling and got some info from https://www.linuxfromscratch.org/lfs/view/stable-systemd/ and https://github.com/LeeKyuHyuk/PiCLFS/\
/Mikael
#define RELATIVE_SOURCE_PATH is being set to absolute path.
Changing it to #define RELATIVE_SOURCE_PATH "../" solves the issue

Can't locate File/Slurp.pm in #INC

I'm trying to compile an uefi application on Ubuntu 20.04.2 LTS but the compilation terminates with an error.
./mkkeys.sh
Enter a Common Name to embed in the keys: keys
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c cert-to-efi-sig-list.c -o cert-to-efi-sig-list.o
cert-to-efi-sig-list.c:9: warning: "__STDC_VERSION__" redefined
9 | #define __STDC_VERSION__ 199901L
|
<built-in>: note: this is the location of the previous definition
make -C lib lib.a
make[1]: Entering directory '/home/jr/Downloads/xen-uefi/efitools/lib'
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c simple_file.c -o simple_file.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c pecoff.c -o pecoff.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c guid.c -o guid.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c sha256.c -o sha256.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c console.c -o console.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c execute.c -o execute.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c configtable.c -o configtable.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c shell.c -o shell.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c security_policy.c -o security_policy.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c shim_protocol.c -o shim_protocol.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c pkcs7verify.c -o pkcs7verify.o
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c kernel_efivars.c -o kernel_efivars.o
kernel_efivars.c:19: warning: "__STDC_VERSION__" redefined
19 | #define __STDC_VERSION__ 199901L
|
<built-in>: note: this is the location of the previous definition
kernel_efivars.c: In function ‘kernel_variable_init’:
kernel_efivars.c:61:2: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
61 | read(fd, buf, st.st_size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
kernel_efivars.c: In function ‘get_variable’:
kernel_efivars.c:107:2: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
107 | read(fd, &attr, sizeof(attr));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel_efivars.c:113:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
113 | read(fd, buf, st.st_size - sizeof(attr));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ar rcv lib.a simple_file.o pecoff.o guid.o sha256.o console.o execute.o configtable.o shell.o security_policy.o shim_protocol.o pkcs7verify.o kernel_efivars.o
a - simple_file.o
a - pecoff.o
a - guid.o
a - sha256.o
a - console.o
a - execute.o
a - configtable.o
a - shell.o
a - security_policy.o
a - shim_protocol.o
a - pkcs7verify.o
a - kernel_efivars.o
make[1]: Leaving directory '/home/jr/Downloads/xen-uefi/efitools/lib'
cc -o cert-to-efi-sig-list cert-to-efi-sig-list.o -lcrypto lib/lib.a
cc -I/home/jr/Downloads/xen-uefi/efitools/include/ -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check -DGNU_EFI_USE_MS_ABI -DEFI_FUNCTION_WRAPPER -mno-red-zone -DCONFIG_x86_64 -c sign-efi-sig-list.c -o sign-efi-sig-list.o
sign-efi-sig-list.c:7: warning: "__STDC_VERSION__" redefined
7 | #define __STDC_VERSION__ 199901L
|
<built-in>: note: this is the location of the previous definition
sign-efi-sig-list.c: In function ‘main’:
sign-efi-sig-list.c:163:3: warning: implicit declaration of function ‘strptime’; did you mean ‘strftime’? [-Wimplicit-function-declaration]
163 | strptime(timestampstr, "%Y-%m-%d %H:%M:%S", &tms);
| ^~~~~~~~
| strftime
sign-efi-sig-list.c:221:2: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
221 | read(fdefifile, ptr, st.st_size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sign-efi-sig-list.c:244:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
244 | read(infile, sigbuf, sigsize);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sign-efi-sig-list.c:316:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
316 | write(fdoutfile, out, outlen);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sign-efi-sig-list.c:319:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
319 | write(fdoutfile, ptr, st.st_size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make -C lib lib.a
make[1]: Entering directory '/home/jr/Downloads/xen-uefi/efitools/lib'
make[1]: 'lib.a' is up to date.
make[1]: Leaving directory '/home/jr/Downloads/xen-uefi/efitools/lib'
cc -o sign-efi-sig-list sign-efi-sig-list.o -lcrypto lib/lib.a
Generating a RSA private key
..........................................+++++
.......................................................................................................+++++
writing new private key to 'PK.key'
-----
Generating a RSA private key
....................................+++++
....................................................................................................+++++
writing new private key to 'KEK.key'
-----
Generating a RSA private key
..................+++++
...........................................................+++++
writing new private key to 'DB.key'
-----
Generating a RSA private key
.............+++++
..................................................+++++
writing new private key to 'SHIM.key'
-----
Timestamp is 2021-9-23 15:55:51
Authentication Payload size 861
Signature of size 1182
Signature at: 40
Timestamp is 2021-9-23 15:55:51
Authentication Payload size 865
Signature of size 1182
Signature at: 40
Timestamp is 2021-9-23 15:55:51
Authentication Payload size 861
Signature of size 1185
Signature at: 40
Timestamp is 2021-9-23 15:55:52
Authentication Payload size 40
Signature of size 1182
Signature at: 40
make -C lib lib.a
make[1]: Entering directory '/home/jr/Downloads/xen-uefi/efitools/lib'
make[1]: 'lib.a' is up to date.
make[1]: Leaving directory '/home/jr/Downloads/xen-uefi/efitools/lib'
./xxdi.pl PK.auth > PK.h
Can't locate File/Slurp.pm in #INC (you may need to install the File::Slurp module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./xxdi.pl line 17.
BEGIN failed--compilation aborted at ./xxdi.pl line 17.
make: *** [Make.rules:69: PK.h] Error 2
What am I doing wrong? Do I need to install perl? which perl in terminal returns the directory in which perl is installed. Does this mean perl isn't the issue? I don't know what other details to give but if someone could point me in the right direction I would really appreciate it.
Perl comes with a large number of standard libraries that extend its capabilities. But there are thousands of other extension libraries available from CPAN.
File::Slurp is a CPAN module. It's not part of the standard Perl distribution, so you'll need to install it separately.
Fortunately, Ubuntu packages up a huge number of CPAN modules and make them available from their standard repositories. So, to install it, you just have to run:
$ sudo apt-get install libfile-slurp-perl

Error when bitbake on meta-browser layer, gn-native package for Yocto zeus

I am trying to generate a Yocto Linux from a Ubuntu 18.04 but run into an error when compiling gn-native from Chromium inside meta-browser layer. As I just add this layer without modifying it, I am a bit lost and error doesn not talk to me much.
> ERROR: gn-native-80.0.3987.132-r0 do_compile: Execution of '/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/temp/run.do_compile.13120'
> failed with exit code 1:
> ninja: Entering directory `/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/chromium-80.0.3987.132/out/Release/gn_build'
> [1/182] CXX base/callback_internal.o
> FAILED: base/callback_internal.o
> clang++ -MMD -MF base/callback_internal.o.d -I../../../tools/gn -I. -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -DNDEBUG -O3 -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -std=c++17 -c ../../../tools/gn/base/callback_internal.cc -o base/callback_internal.o
> In file included from ../../../tools/gn/base/callback_internal.cc:5:
> In file included from ../../../tools/gn/base/callback_internal.h:13:
> ../../../tools/gn/base/memory/ref_counted.h:10:10: fatal error: 'utility' file not found
> #include <utility>
> ^~~~~~~~~
> 1 error generated.
> [2/182] CXX base/command_line.o
> FAILED: base/command_line.o
> clang++ -MMD -MF base/command_line.o.d -I../../../tools/gn -I. -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -DNDEBUG -O3 -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -std=c++17 -c ../../../tools/gn/base/command_line.cc -o base/command_line.o
> In file included from ../../../tools/gn/base/command_line.cc:5:
> ../../../tools/gn/base/command_line.h:19:10: fatal error: 'map' file not found
> #include <map>
> ^~~~~
> 1 error generated.
> [3/182] CXX base/environment.o
> FAILED: base/environment.o
> clang++ -MMD -MF base/environment.o.d -I../../../tools/gn -I. -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -DNDEBUG -O3 -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -std=c++17 -c ../../../tools/gn/base/environment.cc -o base/environment.o
> In file included from ../../../tools/gn/base/environment.cc:5:
> ../../../tools/gn/base/environment.h:8:10: fatal error: 'map' file not found
> #include <map>
> ^~~~~
> 1 error generated.
> [4/182] CXX base/files/file_path_constants.o
> FAILED: base/files/file_path_constants.o
> clang++ -MMD -MF base/files/file_path_constants.o.d -I../../../tools/gn -I. -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -DNDEBUG -O3 -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -std=c++17 -c ../../../tools/gn/base/files/file_path_constants.cc -o
> base/files/file_path_constants.o
> In file included from ../../../tools/gn/base/files/file_path_constants.cc:7:
> ../../../tools/gn/base/files/file_path.h:107:10: fatal error: 'iosfwd' file not found
> #include <iosfwd>
> ^~~~~~~~
> 1 error generated.
> [5/182] CXX base/files/file.o
> FAILED: base/files/file.o
> clang++ -MMD -MF base/files/file.o.d -I../../../tools/gn -I. -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -DNDEBUG -O3 -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -std=c++17 -c ../../../tools/gn/base/files/file.cc -o base/files/file.o
> In file included from ../../../tools/gn/base/files/file.cc:5:
> ../../../tools/gn/base/files/file.h:10:10: fatal error: 'string' file not found
> #include <string>
> ^~~~~~~~
> 1 error generated.
> [6/182] CXX base/files/file_path.o
> FAILED: base/files/file_path.o
> clang++ -MMD -MF base/files/file_path.o.d -I../../../tools/gn -I. -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -DNDEBUG -O3 -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -std=c++17 -c ../../../tools/gn/base/files/file_path.cc -o base/files/file_path.o
> In file included from ../../../tools/gn/base/files/file_path.cc:5:
> ../../../tools/gn/base/files/file_path.h:107:10: fatal error: 'iosfwd' file not found
> #include <iosfwd>
> ^~~~~~~~
> 1 error generated.
> [7/182] CXX base/files/file_enumerator.o
> FAILED: base/files/file_enumerator.o
> clang++ -MMD -MF base/files/file_enumerator.o.d -I../../../tools/gn -I. -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -DNDEBUG -O3 -fdata-sections -ffunction-sections -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -isystem/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/include -O2 -pipe -std=c++17 -c ../../../tools/gn/base/files/file_enumerator.cc -o
> base/files/file_enumerator.o
> In file included from ../../../tools/gn/base/files/file_enumerator.cc:5:
> ../../../tools/gn/base/files/file_enumerator.h:11:10: fatal error: 'vector' file not found
> #include <vector>
> ^~~~~~~~
> 1 error generated.
> ninja: build stopped: subcommand failed.
> Traceback (most recent call last):
> File "/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/chromium-80.0.3987.132/tools/gn/bootstrap/bootstrap.py", line 138, in <module>
> sys.exit(main(sys.argv[1:]))
> File "/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/chromium-80.0.3987.132/tools/gn/bootstrap/bootstrap.py", line 124, in main
> ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
> File "/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/recipe-sysroot-native/usr/lib/python2.7/subprocess.py",
> line 190, in check_call
> raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command '['ninja', '-C', '/home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/chromium-80.0.3987.132/out/Release/gn_build', 'gn', '-w', 'dupbuild=err']' returned non-zero exit status 1
> WARNING: exit code 1 from a shell command.
> ERROR: Logfile of failure stored in: /home/tux/yocto-freescale-zeus/build/tmp/work/x86_64-linux/gn-native/80.0.3987.132-r0/temp/log.do_compile.13120
Any help would be greatly appreciated. Thank you!
My fault...
I had to install g++-multilib that was not installed, so basic libraries were not present...
sudo apt install g++-multilib

How to use Arduino-Makefile with Sparkfun Pro Micro?

So, I am using Arduino-Makefile (https://github.com/sudar/Arduino-Makefile) and trying to program a 5V 16MHz Sparkfun Pro Micro (https://www.sparkfun.com/products/12640).
I am using the versions of the Arduino libraries and Arduino-Makefile in the repository of the Linux distro I am using (Linux Mint 17.2). These versions are 1.0.5 and 1.3.1 respectively.
My file structure looks like this:
<project-root>/
sparkfun/
... Sparkfun Arduino Addon Files (https://github.com/sparkfun/SF32u4_boards/)
src/
Makefile
test.ino
My test.ino is taken directly from here: https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide#example-1-blinkies and looks like this:
/* Pro Micro Test Code
by: Nathan Seidle
modified by: Jim Lindblom
SparkFun Electronics
date: September 16, 2013
license: Public Domain - please use this code however you'd like.
It's provided as a learning tool.
This code is provided to show how to control the SparkFun
ProMicro's TX and RX LEDs within a sketch. It also serves
to explain the difference between Serial.print() and
Serial1.print().
*/
int RXLED = 17; // The RX LED has a defined Arduino pin
// The TX LED was not so lucky, we'll need to use pre-defined
// macros (TXLED1, TXLED0) to control that.
// (We could use the same macros for the RX LED too -- RXLED1,
// and RXLED0.)
void setup()
{
pinMode(RXLED, OUTPUT); // Set RX LED as an output
// TX LED is set as an output behind the scenes
Serial.begin(9600); //This pipes to the serial monitor
Serial1.begin(9600); //This is the UART, pipes to sensors attached to board
}
void loop()
{
Serial.println("Hello world"); // Print "Hello World" to the Serial Monitor
Serial1.println("Hello!"); // Print "Hello!" over hardware UART
digitalWrite(RXLED, LOW); // set the LED on
TXLED0; //TX LED is not tied to a normally controlled pin
delay(1000); // wait for a second
digitalWrite(RXLED, HIGH); // set the LED off
TXLED1;
delay(1000); // wait for a second
}
My Makefile, which is very short yet embarrassingly messy, looks like this:
MONITOR_PORT = /dev/ttyACM0
CPPFLAGS += -std=c++11 -I$(realpath ../sparkfun/avr/variants/promicro) -w -DUSB_VID=6991 -DUSB_PID=37381
# --- sparkfun pro micro
BOARD_TAG = promicro16
ALTERNATE_CORE = $(realpath ../sparkfun/avr)
ARDUINO_VAR_PATH = $(realpath ../sparkfun/avr/bootloaders)
BOARDS_TXT = $(realpath ../sparkfun/avr/boards.txt)
BOOTLOADER_PARENT = $(realpath ../sparkfun/avr/bootloaders)
BOOTLOADER_PATH = caterina
BOOTLOADER_FILE = Caterina-promicro16.hex
ISP_PROG = usbasp
USER_LIB_PATH := $(realpath ../lib)
include /usr/share/arduino/Arduino.mk
Everything builds fine, but the programmer complains when I try a make upload. The Pro Micro is /dev/ttyACM0, which I have confirmed by doing an ls /dev/tty* with the device both plugged in and not plugged in and comparing the outputs.
Here is the result of a straight up make:
-------------------------
Arduino.mk Configuration:
- [AUTODETECTED] CURRENT_OS = LINUX
- [COMPUTED] ARDMK_DIR = /usr/share/arduino (relative to Common.mk)
- [AUTODETECTED] ARDUINO_DIR = /usr/share/arduino
- [AUTODETECTED] ARDUINO_VERSION = 105
- [DEFAULT] ARDUINO_SKETCHBOOK = /home/kota/sketchbook
- [BUNDLED] AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr (in Arduino distribution)
- [COMPUTED] ARDUINO_LIB_PATH = /usr/share/arduino/libraries (from ARDUINO_DIR)
- [DEFAULT] ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/cores/arduino
- [USER] ALTERNATE_CORE = /home/kota/Projects/tinyIMU/arduino/sparkfun/avr
- [COMPUTED] ALTERNATE_CORE_PATH = /home/kota/sketchbook/hardware//home/kota/Projects/tinyIMU/arduino/sparkfun/avr (from ARDUINO_SKETCHBOOK and ALTERNATE_CORE)
- [DEFAULT] USER_LIB_PATH = /home/kota/sketchbook/libraries (in user sketchbook)
- [USER] BOARD_TAG = promicro16
- [COMPUTED] OBJDIR = build-promicro16 (from BOARD_TAG)
- [ASSUMED] MONITOR_BAUDRATE = 9600
- [DEFAULT] OPTIMIZATION_LEVEL = s
- [DEFAULT] MCU_FLAG_NAME = mmcu
- [DEFAULT] CFLAGS_STD = -std=gnu99
- [AUTODETECTED] Size utility: AVR-aware for enhanced output
- [USER] BOOTLOADER_PARENT = /home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders
-------------------------
mkdir -p build-promicro16
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions tinyimu.ino -o build-promicro16/tinyimu.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts.c -o build-promicro16/WInterrupts.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os /usr/share/arduino/hardware/arduino/cores/arduino/wiring_analog.c -o build-promicro16/wiring_analog.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os /usr/share/arduino/hardware/arduino/cores/arduino/wiring.c -o build-promicro16/wiring.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.c -o build-promicro16/wiring_digital.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c -o build-promicro16/wiring_pulse.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os /usr/share/arduino/hardware/arduino/cores/arduino/wiring_shift.c -o build-promicro16/wiring_shift.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/CDC.cpp -o build-promicro16/CDC.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp -o build-promicro16/HardwareSerial.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/HID.cpp -o build-promicro16/HID.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/IPAddress.cpp -o build-promicro16/IPAddress.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp -o build-promicro16/main.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/new.cpp -o build-promicro16/new.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/Print.cpp -o build-promicro16/Print.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/Stream.cpp -o build-promicro16/Stream.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp -o build-promicro16/Tone.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp -o build-promicro16/USBCore.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/WMath.cpp -o build-promicro16/WMath.o
/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -std=c++11 -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/variants/promicro -w -DUSB_VID=6991 -DUSB_PID=37381 -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders/promicro -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions /usr/share/arduino/hardware/arduino/cores/arduino/WString.cpp -o build-promicro16/WString.o
/usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs build-promicro16/libcore.a build-promicro16/WInterrupts.o build-promicro16/wiring_analog.o build-promicro16/wiring.o build-promicro16/wiring_digital.o build-promicro16/wiring_pulse.o build-promicro16/wiring_shift.o build-promicro16/CDC.o build-promicro16/HardwareSerial.o build-promicro16/HID.o build-promicro16/IPAddress.o build-promicro16/main.o build-promicro16/new.o build-promicro16/Print.o build-promicro16/Stream.o build-promicro16/Tone.o build-promicro16/USBCore.o build-promicro16/WMath.o build-promicro16/WString.o
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc -mmcu=atmega32u4 -Wl,--gc-sections -Os -o build-promicro16/src.elf build-promicro16/tinyimu.o build-promicro16/libcore.a -lc -lm
/usr/share/arduino/hardware/tools/avr/bin/avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O ihex build-promicro16/src.elf build-promicro16/src.eep
/usr/share/arduino/hardware/tools/avr/bin/avr-objcopy: --change-section-lma .eeprom=0x0000000000000000 never used
/usr/share/arduino/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom build-promicro16/src.elf build-promicro16/src.hex
/usr/share/arduino/hardware/tools/avr/bin/avr-size --mcu=atmega32u4 -C --format=avr build-promicro16/src.elf
AVR Memory Usage
----------------
Device: atmega32u4
Program: 4808 bytes (14.7% Full)
(.text + .data + .bootloader)
Data: 163 bytes (6.4% Full)
(.data + .bss + .noinit)
and the output of make upload:
-------------------------
Arduino.mk Configuration:
- [AUTODETECTED] CURRENT_OS = LINUX
- [COMPUTED] ARDMK_DIR = /usr/share/arduino (relative to Common.mk)
- [AUTODETECTED] ARDUINO_DIR = /usr/share/arduino
- [AUTODETECTED] ARDUINO_VERSION = 105
- [DEFAULT] ARDUINO_SKETCHBOOK = /home/kota/sketchbook
- [BUNDLED] AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr (in Arduino distribution)
- [COMPUTED] ARDUINO_LIB_PATH = /usr/share/arduino/libraries (from ARDUINO_DIR)
- [DEFAULT] ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/cores/arduino
- [USER] ALTERNATE_CORE = /home/kota/Projects/tinyIMU/arduino/sparkfun/avr
- [COMPUTED] ALTERNATE_CORE_PATH = /home/kota/sketchbook/hardware//home/kota/Projects/tinyIMU/arduino/sparkfun/avr (from ARDUINO_SKETCHBOOK and ALTERNATE_CORE)
- [DEFAULT] USER_LIB_PATH = /home/kota/sketchbook/libraries (in user sketchbook)
- [USER] BOARD_TAG = promicro16
- [COMPUTED] OBJDIR = build-promicro16 (from BOARD_TAG)
- [ASSUMED] MONITOR_BAUDRATE = 9600
- [DEFAULT] OPTIMIZATION_LEVEL = s
- [DEFAULT] MCU_FLAG_NAME = mmcu
- [DEFAULT] CFLAGS_STD = -std=gnu99
- [AUTODETECTED] Size utility: AVR-aware for enhanced output
- [USER] BOOTLOADER_PARENT = /home/kota/Projects/tinyIMU/arduino/sparkfun/avr/bootloaders
-------------------------
make reset
make[1]: Entering directory `/home/kota/Projects/tinyIMU/arduino/src'
/usr/bin/ard-reset-arduino /dev/ttyACM0
make[1]: Leaving directory `/home/kota/Projects/tinyIMU/arduino/src'
make do_upload
make[1]: Entering directory `/home/kota/Projects/tinyIMU/arduino/src'
/usr/share/arduino/hardware/tools/avr/../avrdude -q -V -D -p atmega32u4 -C /usr/share/arduino/hardware/tools/avr/../avrdude.conf -c avr109 -b 57600 -P /dev/ttyACM0 \
-U flash:w:build-promicro16/src.hex:i
Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
make[1]: *** [do_upload] Error 1
make[1]: Leaving directory `/home/kota/Projects/tinyIMU/arduino/src'
make: *** [upload] Error 2
Now, because of the error, I figure it's something wrong with my configuration of the bootloader, but I am unsure. Maybe the programmer setting is wrong? I would appreciate any help! :)
Here's what worked for me.
First, go to the hardware folder in your Arduino sketchbook or create it if it does not exist. Then extract the sparkfun addon files into the hardware folder. Your directory structure should look something like this:$SKETCHBOOK_DIR/hardware/sparkfun/avr/.
Then in your project directory use this makefile:
BOARD_TAG = promicro16
ALTERNATE_CORE = sparkfun
ARDUINO_DIR = /usr/share/arduino
include $(ARDUINO_DIR)/Arduino.mk
upload2:
avrdude -p atmega32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:build-$(BOARD_TAG)/$(TARGET).hex
Then you should be able to run make and make upload. However, if your code does something that disables or overrides the default USB behaviour on the pro-micro, then Arduino-mk will not be able to reset the pro-micro into bootloader mode over USB. Instead short the GND and RESET pins twice to get into bootloader mode. Then make upload2 flash the pro-micro (Note: the pro-micro only stays in bootloader mode for 8 seconds).

Problems building Chromium with ninja on Linux

I'm currently trying to build Chromium on Ubuntu 14.10 with Ninja. I've been encountering a few issues so far I've been able to fix, but I've got problems with this one. I'm at the building state.
ninja: Entering directory `out/Release' [3/18153] CC
obj/third_party/flac/src/libFLAC/libflac.float.o FAILED:
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF
obj/third_party/flac/src/libFLAC/libflac.float.o.d
-DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=223108 -DCOMPONENT_BUILD -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DUSE_UDEV -DDONT_EMBED_BUILD_METADATA -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFLAC__NO_DLL -DFLAC__OVERFLOW_DETECT '-DVERSION="1.2.1"' -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../third_party/flac/include -I../../third_party/flac/src/libFLAC/include -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /home/florent/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so
-Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-weak-ptr-factory-order -Xclang -plugin-arg-find-bad-constructs -Xclang strict-virtual-specifiers -momit-leaf-frame-pointer
-mstack-alignment=16 -mstackrealign -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-conversion -Wno-format -Wno-unused-result -msse2 -mfpmath=sse -mmmx -m32 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -c ../../third_party/flac/src/libFLAC/float.c -o
obj/third_party/flac/src/libFLAC/libflac.float.o
../../third_party/llvm-build/Release+Asserts/bin/clang: 1:
../../third_party/llvm-build/Release+Asserts/bin/clang: Syntax error:
")" unexpected [3/18153] CC
obj/third_party/flac/src/libFLAC/libflac.format.o FAILED:
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF
obj/third_party/flac/src/libFLAC/libflac.format.o.d
-DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=223108 -DCOMPONENT_BUILD -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DUSE_UDEV -DDONT_EMBED_BUILD_METADATA -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFLAC__NO_DLL -DFLAC__OVERFLOW_DETECT '-DVERSION="1.2.1"' -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../third_party/flac/include -I../../third_party/flac/src/libFLAC/include -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /home/florent/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so
-Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-weak-ptr-factory-order -Xclang -plugin-arg-find-bad-constructs -Xclang strict-virtual-specifiers -momit-leaf-frame-pointer
-mstack-alignment=16 -mstackrealign -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-conversion -Wno-format -Wno-unused-result -msse2 -mfpmath=sse -mmmx -m32 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -c ../../third_party/flac/src/libFLAC/format.c -o
obj/third_party/flac/src/libFLAC/libflac.format.o
../../third_party/llvm-build/Release+Asserts/bin/clang: 1:
../../third_party/llvm-build/Release+Asserts/bin/clang: Syntax error:
")" unexpected [3/18153] CC
obj/third_party/flac/src/libFLAC/libflac.bitmath.o FAILED:
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF
obj/third_party/flac/src/libFLAC/libflac.bitmath.o.d
-DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=223108 -DCOMPONENT_BUILD -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DUSE_UDEV -DDONT_EMBED_BUILD_METADATA -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFLAC__NO_DLL -DFLAC__OVERFLOW_DETECT '-DVERSION="1.2.1"' -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../third_party/flac/include -I../../third_party/flac/src/libFLAC/include -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /home/florent/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so
-Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-weak-ptr-factory-order -Xclang -plugin-arg-find-bad-constructs -Xclang strict-virtual-specifiers -momit-leaf-frame-pointer
-mstack-alignment=16 -mstackrealign -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-conversion -Wno-format -Wno-unused-result -msse2 -mfpmath=sse -mmmx -m32 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -c ../../third_party/flac/src/libFLAC/bitmath.c -o
obj/third_party/flac/src/libFLAC/libflac.bitmath.o
../../third_party/llvm-build/Release+Asserts/bin/clang: 1:
../../third_party/llvm-build/Release+Asserts/bin/clang: Syntax error:
")" unexpected ninja: build stopped: subcommand failed.
So sorry that it is so ugly to look at it!

Resources