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

src/unix/config/discover.exe puts too much -I includes which can mislead the compiler #944

Open
dinosaure opened this issue May 17, 2022 · 0 comments

Comments

@dinosaure
Copy link
Member

I try to cross-compile lwt.unix with another toolchain than the basic one and it seems that discover.exe puts, by default, some -I (like /usr/include) which can mislead the C compiler about where is the real - in my case - pthread library. I think the first initial behavior should be to try to compile a program with pthread without extra options and only with:

$ cc test.c -o test.exe -lpthread

Indeed, the C compiler used can, internally, includes some paths required for such libraries. Behind the scene and specially about a cross-compiler, these includes are definitely different than the usual /usr/include/ but a clash takes place between the host's pthread definition and the one provided by the cross-toolchain if 1) we systematically put -I/usr/include and 2) the cross-compiler puts internally some -I.

I will try to propose a PR which try such path before others to be able to cross-compile lwt.unix.

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

1 participant