When cross-compiling yagears on my x86-64 host machine for a 32-bit RISC-V Buildroot Linux target, I encountered the following error:
FAILED: libyagears.a.p/gears_engine.c.o
riscv32-buildroot-linux-gnu-gcc -Ilibyagears.a.p -I. -I../.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -O0 -g -D_GNU_SOURCE -DENGINE_CTOR -fPIC '' '-DGLESV2_H=<GLES2/gl2.h>' '
-DGLESV2_LIB="libGLESv2.so.2"' '' '-DGLESV1_CM_H=<GLES/gl.h>' '-DGLESV1_CM_LIB="libGLESv1_CM.so.1"'
-MD -MQ libyagears.a.p/gears_engine.c.o -MF libyagears.a.p/gears_engine.c.o.d -o libyagears.a.p/gears_engine.c.o
-c ../../gears_engine.c
riscv32-buildroot-linux-gnu-gcc.br_real: warning: : linker input file unused because linking not done
riscv32-buildroot-linux-gnu-gcc.br_real: error: : linker input file not found: No such file or directory
riscv32-buildroot-linux-gnu-gcc.br_real: warning: : linker input file unused because linking not done
Upon investigation, I found the root cause to be the '' (empty quotes) between -DGLESV2_LIB="libGLESv2.so.2" and -DGLESV1_CM_H=<GLES/gl.h>, passed to the riscv32-buildroot-linux-gnu-gcc command. These empty quotes were generated by the following two lines in the meson.build:
I realized the issue was that pkg-config returned empty CFLAGS for GLESv1-CM and GLESv2 in my Buildroot environment. Although these libraries are installed, no CFLAGS were necessary.
To resolve this, I propose checking if the CFLAGS returned by pkg-config for GLESv1_CM and GLESv2 are empty before passing them to the dependency variables. This will prevent unnecessary empty strings from being passed to the compiler.
When cross-compiling
yagears
on myx86-64 host
machine for a32-bit RISC-V Buildroot Linux target
, I encountered the following error:Upon investigation, I found the root cause to be the
''
(empty quotes) between-DGLESV2_LIB="libGLESv2.so.2"
and-DGLESV1_CM_H=<GLES/gl.h>
, passed to theriscv32-buildroot-linux-gnu-gcc
command. These empty quotes were generated by the following two lines in themeson.build:
I realized the issue was that
pkg-config
returned empty CFLAGS forGLESv1-CM
andGLESv2
in my Buildroot environment. Although these libraries are installed, no CFLAGS were necessary.To resolve this, I propose checking if the CFLAGS returned by
pkg-config
forGLESv1_CM
andGLESv2
are empty before passing them to the dependency variables. This will prevent unnecessary empty strings from being passed to the compiler.