<div dir="ltr"><div>Hello,<br><br>I'm trying to compile OpenWRT on an OpenSuSE 13.1 x86_64 targeting x86 generic (default config). However, I'm getting a strange behavior. In thunk and BB, some packages that compiles for host machine are having problems with pointer size:<br>



<br>openwrt/trunk/build_dir/host/grub-2.02~beta2 $ arch<br>x86_64<br>openwrt/trunk/build_dir/host/grub-2.02~beta2 $ grep SIZEOF_VOID_P config*h<br>config.h:#define BUILD_SIZEOF_VOID_P 8<br><b>config-util.h:#define SIZEOF_VOID_P 4</b><br>



<br>SIZEOF_VOID_P in host should be 8 if compiled for x86_64. And I get x86_64 binaries:<br><br>$ file build_dir/host/grub-2.02~beta2/grub-install<br>build_dir/host/grub-2.02~beta2/grub-install: <b>ELF 64-bit</b> LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=5082730f329f77b19783a7d9f6128bc6f3a45b10, not stripped<br>


<br></div><div>I also get related warnings:<br><br>./include/grub/crypto.h:286:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]<br>     || ((grub_addr_t) outptr & (sizeof (grub_uint64_t) - 1))))<br>



<br></div><div>As it compiles x86_64 program considering a pointer size from 32-bit, programs did not work.<br></div><div><br></div><div>If I run the configure manually (with same args and PATH), the problem is not present:<br>


</div><br>trunk/build_dir/host/grub-2.02~beta2.new $ grep SIZEOF_VOID_P config*h<br>
config.h:#define BUILD_SIZEOF_VOID_P 8<br><b>config-util.h:#define SIZEOF_VOID_P 8</b><br><br><div></div>I isolated the problem to be the usage of CONFIG_SITE=/home/REDETRESC/luizluca/prog-local/openwrt/trunk/include/site/i486-openwrt-linux-uclibc<br>


<br><div>Is the usage of i486-openwrt-linux-uclibc expected? Should it be x86_64-openwrt-linux-uclibc for host compile?<br><br></div><div>In Ubuntu, I get no problem.<br><br></div><div></div><div>In AA, I had no problem. The configure args from grub in AA and grub2 from BB/trunk have some differences. In AA, I have a single --target=x86_64-suse-linux but grub binaries are 32bit (but other host/compile packages are 64-bit).<br>


<br>In BB/trunk I have duplicated --target= arg in configure. The first is  --target=x86_64-suse-linux but the second one is --target=i486-openwrt-linux-uclibc. This might trigger cross compiling.<br><br></div><div>This is host configure in BB/trunk:<br>


</div><div><br>(cd /home/REDETRESC/luizluca/prog-local/openwrt/trunk/build_dir/host/grub-2.02~beta2/; if [ -x configure ]; then cp -fpR /home/REDETRESC/luizluca/prog-local/openwrt/trunk/scripts/config.{guess,sub} /home/REDETRESC/luizluca/prog-local/openwrt/trunk/build_dir/host/grub-2.02~beta2// &&  /bin/bash ./configure CC="gcc" CFLAGS="-O2 -I/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host/include -g" CPPFLAGS="-I/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host/include" LDFLAGS="-L/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host/lib" SHELL="/bin/bash" <b>--target=x86_64-suse-linux </b>--host=x86_64-suse-linux --build=x86_64-suse-linux --program-prefix="" --program-suffix="" --prefix=/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host --exec-prefix=/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host --sysconfdir=/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host/etc --localstatedir=/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host/var --sbindir=/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host/bin<b> --target=i486-openwrt-linux-</b>uclibc --sbindir="/home/REDETRESC/luizluca/prog-local/openwrt/trunk/staging_dir/host/bin" --disable-werror --disable-libzfs --disable-nls ; fi )<br>


configure: loading site script /home/REDETRESC/luizluca/prog-local/openwrt/trunk/include/site/i486-openwrt-linux-uclibc<br>configure: loading site script /home/REDETRESC/luizluca/prog-local/openwrt/trunk/include/site/i486-openwrt-linux-uclibc<br>


checking build system type... <b>x86_64-suse-linux-gnu</b><br>checking host system type...<b> x86_64-suse-linux-gnu</b><br>checking target system type...<b> i486-openwrt-linux-uclibc</b><br></div><div><br>In Makefile, I have:<br>


<br>package/boot/grub2/Makefile:<br> 54 HOST_CONFIGURE_ARGS += \<br> 55     --target=$(REAL_GNU_TARGET_NAME) \<br><br></div><div>If I remove target, it does not change.<br></div><div><br>Do you guys have any clue?<br></div>

<div><br>Regards,<br></div><div><br clear="all">
<div><div>---<br>     Luiz Angelo Daros de Luca, Me.<br>            <a href="mailto:luizluca@gmail.com" target="_blank">luizluca@gmail.com</a></div>

</div></div></div>