raspberrypi / userland

Source code for ARM side libraries for interfacing to Raspberry Pi GPU.
BSD 3-Clause "New" or "Revised" License
2.05k stars 1.09k forks source link

Error while compiling natively with Fedora 30 __bitwise redefined #582

Open Nolaan opened 5 years ago

Nolaan commented 5 years ago

Hello, I'm running into a compile time error while building natively on the raspberry pi 3B running Fedora 30

[ 99%] Built target dtovl
[100%] Building C object host_applications/linux/apps/dtoverlay/CMakeFiles/dtoverlay.dir/dtoverlay_main.c.o
In file included from /root/compile/userland/opensrc/helpers/libfdt/libfdt.h:54,
                 from /root/compile/userland/host_applications/linux/apps/dtoverlay/dtoverlay_main.c:37:
/root/compile/userland/opensrc/helpers/libfdt/libfdt_env.h:64: error: "__bitwise" redefined [-Werror]
   64 | #define __bitwise
      | 
In file included from /usr/include/linux/stat.h:5,
                 from /usr/include/bits/statx.h:30,
                 from /usr/include/sys/stat.h:446,
                 from /root/compile/userland/host_applications/linux/apps/dtoverlay/dtoverlay_main.c:33:
/usr/include/linux/types.h:22: note: this is the location of the previous definition
   22 | #define __bitwise __bitwise__
      | 
cc1: all warnings being treated as errors
make[2]: *** [host_applications/linux/apps/dtoverlay/CMakeFiles/dtoverlay.dir/build.make:63: host_applications/linux/apps/dtoverlay/CMakeFiles/dtoverlay.dir/dtoverlay_main.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4520: host_applications/linux/apps/dtoverlay/CMakeFiles/dtoverlay.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

The include hierarchy is somewhat buggy

satmandu commented 5 years ago

This fixes it for me:

sed -i 's/__bitwise/FDT_BITWISE/' rpi-userland/opensrc/helpers/libfdt/libfdt_env.h
sed -i 's/__force/FDT_FORCE/' rpi-userland/opensrc/helpers/libfdt/libfdt_env.h

This is what has been done in libfdt in newer kernels as far as I can tell.

Nolaan commented 5 years ago

Thanks

pelwell commented 4 years ago

@popcornmix Can we push the updated libfdt to userland?

popcornmix commented 4 years ago

@pelwell should be done now

pelwell commented 4 years ago

Please retest, and close the issue if the problem is resolved.