Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odroidc2-v2015.01 can't build API #30

Closed
iamGavinJ opened this issue Sep 4, 2016 · 2 comments
Closed

odroidc2-v2015.01 can't build API #30

iamGavinJ opened this issue Sep 4, 2016 · 2 comments

Comments

@iamGavinJ
Copy link

iamGavinJ commented Sep 4, 2016

Hi,
I'm trying to include API and ELF in the build to enable ubldr for FreeBSD by including the following defines in the include/configs/odroidc2.h

#ifndef CONFIG_SPL_BUILD
#define CONFIG_API
#define CONFIG_CMD_ELF
#define CONFIG_SYS_MMC_MAX_DEVICE 1
#endif

And I'm getting a number of

error: cast to pointer from integer of different size

I'm building on native with the qemu-user process from #23

Full output follows:

root@odroid64:~/u-boot# make
  GEN     ./Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config.h
  UPD     include/config.h
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep
  CHK     include/config/uboot.release
  UPD     include/config/uboot.release
  Using .. as source for U-Boot
  GEN     ./Makefile
  CHK     include/generated/version_autogenerated.h
  UPD     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  CC      lib/asm-offsets.s
  GEN     include/generated/generic-asm-offsets.h
  CC      arch/arm/lib/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  HOSTCC  tools/gen_eth_addr
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/os_support.o
  WRAP    tools/lib/crc32.c
  HOSTCC  tools/lib/crc32.o
  HOSTLD  tools/mkenvimage
  HOSTCC  tools/aisimage.o
  HOSTCC  tools/atmelimage.o
  WRAP    tools/common/bootm.c
  HOSTCC  tools/common/bootm.o
  HOSTCC  tools/default_image.o
  WRAP    tools/lib/fdtdec_common.c
  HOSTCC  tools/lib/fdtdec_common.o
  WRAP    tools/lib/fdtdec.c
  HOSTCC  tools/lib/fdtdec.o
  HOSTCC  tools/fit_common.o
  HOSTCC  tools/fit_image.o
  HOSTCC  tools/gpimage.o
  HOSTCC  tools/gpimage-common.o
  WRAP    tools/common/image-fit.c
  HOSTCC  tools/common/image-fit.o
  HOSTCC  tools/image-host.o
  WRAP    tools/common/image.c
  HOSTCC  tools/common/image.o
  HOSTCC  tools/imagetool.o
  HOSTCC  tools/imximage.o
  HOSTCC  tools/kwbimage.o
  WRAP    tools/lib/md5.c
  HOSTCC  tools/lib/md5.o
  HOSTCC  tools/mxsimage.o
  HOSTCC  tools/omapimage.o
  HOSTCC  tools/pblimage.o
  HOSTCC  tools/pbl_crc32.o
  HOSTCC  tools/socfpgaimage.o
  WRAP    tools/lib/sha1.c
  HOSTCC  tools/lib/sha1.o
  WRAP    tools/lib/sha256.c
  HOSTCC  tools/lib/sha256.o
  HOSTCC  tools/ublimage.o
  WRAP    tools/lib/libfdt/fdt.c
  HOSTCC  tools/lib/libfdt/fdt.o
  WRAP    tools/lib/libfdt/fdt_ro.c
  HOSTCC  tools/lib/libfdt/fdt_ro.o
  WRAP    tools/lib/libfdt/fdt_rw.c
  HOSTCC  tools/lib/libfdt/fdt_rw.o
  WRAP    tools/lib/libfdt/fdt_strerror.c
  HOSTCC  tools/lib/libfdt/fdt_strerror.o
  WRAP    tools/lib/libfdt/fdt_wip.c
  HOSTCC  tools/lib/libfdt/fdt_wip.o
  HOSTCC  tools/dumpimage.o
  HOSTLD  tools/dumpimage
  HOSTCC  tools/mkimage.o
  HOSTLD  tools/mkimage
  HOSTCC  tools/proftool
  HOSTCC  tools/relocate-rela
  CC      api/api.o
../api/api.c: In function ‘API_getc’:
../api/api.c:55:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((c = (int *)va_arg(ap, u_int32_t)) == NULL)
           ^
../api/api.c: In function ‘API_tstc’:
../api/api.c:71:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((t = (int *)va_arg(ap, u_int32_t)) == NULL)
           ^
../api/api.c: In function ‘API_putc’:
../api/api.c:87:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((c = (char *)va_arg(ap, u_int32_t)) == NULL)
           ^
../api/api.c: In function ‘API_puts’:
../api/api.c:103:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((s = (char *)va_arg(ap, u_int32_t)) == NULL)
           ^
../api/api.c: In function ‘API_get_sys_info’:
../api/api.c:135:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  si = (struct sys_info *)va_arg(ap, u_int32_t);
       ^
../api/api.c: In function ‘API_udelay’:
../api/api.c:151:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((d = (unsigned long *)va_arg(ap, u_int32_t)) == NULL)
           ^
../api/api.c: In function ‘API_get_timer’:
../api/api.c:167:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  cur = (unsigned long *)va_arg(ap, u_int32_t);
        ^
../api/api.c:171:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  base = (unsigned long *)va_arg(ap, u_int32_t);
         ^
../api/api.c: In function ‘API_dev_enum’:
../api/api.c:202:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  di = (struct device_info *)va_arg(ap, u_int32_t);
       ^
../api/api.c: In function ‘API_dev_open’:
../api/api.c:236:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  di = (struct device_info *)va_arg(ap, u_int32_t);
       ^
../api/api.c: In function ‘API_dev_close’:
../api/api.c:268:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  di = (struct device_info *)va_arg(ap, u_int32_t);
       ^
../api/api.c: In function ‘API_dev_write’:
../api/api.c:322:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  di = (struct device_info *)va_arg(ap, u_int32_t);
       ^
../api/api.c:332:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  buf = (void *)va_arg(ap, u_int32_t);
        ^
../api/api.c:337:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  len = (int *)va_arg(ap, u_int32_t);
        ^
../api/api.c: In function ‘API_dev_read’:
../api/api.c:390:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  di = (struct device_info *)va_arg(ap, u_int32_t);
       ^
../api/api.c:400:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  buf = (void *)va_arg(ap, u_int32_t);
        ^
../api/api.c:406:14: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   len_stor = (lbasize_t *)va_arg(ap, u_int32_t);
              ^
../api/api.c:413:11: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   start = (lbastart_t *)va_arg(ap, u_int32_t);
           ^
../api/api.c:416:18: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   act_len_stor = (lbasize_t *)va_arg(ap, u_int32_t);
                  ^
../api/api.c:425:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   len_net = (int *)va_arg(ap, u_int32_t);
             ^
../api/api.c:432:17: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   act_len_net = (int *)va_arg(ap, u_int32_t);
                 ^
../api/api.c: In function ‘API_env_get’:
../api/api.c:456:14: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((name = (char *)va_arg(ap, u_int32_t)) == NULL)
              ^
../api/api.c:458:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((value = (char **)va_arg(ap, u_int32_t)) == NULL)
               ^
../api/api.c: In function ‘API_env_set’:
../api/api.c:479:14: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((name = (char *)va_arg(ap, u_int32_t)) == NULL)
              ^
../api/api.c:481:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((value = (char *)va_arg(ap, u_int32_t)) == NULL)
               ^
../api/api.c: In function ‘API_env_enum’:
../api/api.c:501:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  last = (char *)va_arg(ap, u_int32_t);
         ^
../api/api.c:503:14: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  if ((next = (char **)va_arg(ap, u_int32_t)) == NULL)
              ^
cc1: all warnings being treated as errors
../scripts/Makefile.build:275: recipe for target 'api/api.o' failed
make[2]: *** [api/api.o] Error 1
/root/u-boot/Makefile:1155: recipe for target 'api' failed
make[1]: *** [api] Error 2
Makefile:147: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
@bkrepo
Copy link

bkrepo commented Sep 8, 2016

@iamGavinJ 's PR which is for fixing this issue was merged.

But, there is a still build error. Upstream u-boot also has same problem when building with CONFIG_API for arm64 target.

../examples/api/crt0.S: Assembler messages:
../examples/api/crt0.S:33: Error: operand 1 should be an integer register -- `ldr ip,=search_hint'
../examples/api/crt0.S:34: Error: operand 1 should be an integer register -- `str sp,[ip]'
../examples/api/crt0.S:40: Error: operand 1 should be an integer register -- `ldr ip,=syscall_ptr'
../examples/api/crt0.S:41: Error: operand 1 should be an integer register -- `ldr pc,[ip]'
../scripts/Makefile.build:311: recipe for target 'examples/api/crt0.o' failed

@bkrepo
Copy link

bkrepo commented Sep 8, 2016

I wrote the patch to build u-boot with CONFIG_API option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants