OpenC2X embedded for OpenWrt does not build

When trying to build OpenC2X-embedded (integrated with OpenWrt) from this Github repository https://github.com/florianklingler/OpenC2X-embedded, I have encountered a build error that results from conflicting function names. There are two functions named copy_file_range - one is in the create_inode.c file and the other one in the unistd.h header that the mentioned file includes. What I would like to know is if someone else has encountered this previously and if there is some known fix or an elegant way to handle this issue that you might have come up with.

The running setups I have tried this on are Linux Mint 19 and Ubuntu 18.04.2 run as a virtual machine (fully installed version)
The build error is very simple to reproduce, we do as follows:

  1. Clone the Github repository linked above
  2. Run the commands as listed in the readme.md file
  3. You might going to have to install a few dependencies (I had to install three of them) - they are going to be listed in the terminal when you run the second command from the readme file above (./scripts/feeds install -a). I have listed these, as well as how to install them in an attached file named Dependencies .

I saw that it seems you opened a ticket on the OpenC2X github. That's probably the right place, between it being a fork and that fork being relatively old and seemingly not kept current. Many OpenWrt forks don't change the description or README, so they still suggest that problems be reported to OpenWrt, among other things.

Trying an x86_64 build here, as it wasn't obvious where create_inode.c was from the source alone.

Build succeeded with no errors.

Can you provide more detailed steps to replicate?

Thank you for your response first of all.

create_inode.c is located at OpenC2X/OpenC2X-embedded/build_dir/host/e2fsprogs-1.43.3/misc
That file contains a copy_file_range function and there is a prototype/declaration for a function with the same name but different return data type and argument list in unistd.h header located in /usr/include.
This is also something I don't really understand - the prototype in the header and the function signature in the .c file are not matching.

For the steps to replicate - sorry for that, I pretty much covered them in the initial post. The process is very short, just cloning and then running things from README.
Also, I did not completely get what you meant by:
Trying an x86_64 build here, as it wasn't obvious where create_inode.c was from the source alone
Thank you for your help in any case.

I can build it here with no errors.

clone, then

./scripts/feeds update -a
./scripts/feeds install -a
./create_config.sh x86_64
make menuconfig  # Exit with no changes other than enabling ccache and logs
make -j12 clean download world

runs sucessfully to completion

[...]
 make[2] package/install
 make[3] -C package/libs/libubox host-compile
 make[3] -C package/system/opkg host-compile
 make[3] package/preconfig
 make[2] target/install
 make[3] -C target/linux install
 make[2] package/index
 make[2] diffconfig
 make[2] checksum
jeff@deb-devel:~/devel/OpenC2X-embedded$

which is why I asked for more details on what you were doing to build it.

About the x86_64 build question that I asked - yes, I did the same. I ran
./create_config.sh x86_64
The instructions specify the three architectures to be allowed, I also built for x86_64.

Given that it's a host binary, it is likely a configuration issue with your build host. I am running Debian 9.9 here.