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

Fix build on WSL and remove Python #85

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jmeggitt
Copy link
Contributor

The previous version would attempt to fetch the required headers from every include folder, overwriting the previous results as it went and in my case, stumbling over broken symlinks in duplicate folders.

The python script would return all of the include folders (example result):

# Include directories given by python script (example from when I ran it): 
*/arm-frc2019-linux-gnueabi/usr/lib/gcc/arm-frc2019-linux-gnueabi/6.3.0/include
*/arm-frc2019-linux-gnueabi/usr/lib/gcc/arm-frc2019-linux-gnueabi/6.3.0/include-fixed
*/arm-frc2019-linux-gnueabi/usr/include

# The includes we actually care about:
*/arm-frc2019-linux-gnueabi/usr/include
*/arm-frc2019-linux-gnueabi/usr/lib/**/include/stddef.h

Since the python script just ran a command and trimmed the results, I moved the functionality to the makefile instead and was able to make it more verbose as a result.

@@ -6,6 +6,20 @@
# except according to those terms.

local_dir := $(dir $(lastword $(MAKEFILE_LIST)))
toolchain := $$CXX_FRC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct, or should be $(CXX_FRC)?

Copy link
Contributor Author

@jmeggitt jmeggitt Nov 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, thats correct. Makefiles have weird syntax and work with their own variable system.

If I were to try referencing an environment variable the regular way, it would start parsing and give up when it realizes there are no makefile variables that could fit. So if I had defined CXX2 before hand, it would give up half way through and delete the characters up to the point where it failed. The resulting line would become toolchain := _FRC. A second $ acts as an escape character and allows it to be read like any other shell command. Thats also why I included two on line 20.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right. I think the better way to deal with this would be to use ?=.

@auscompgeek
Copy link
Member

Say, why do we even copy headers in the first place? The correct way to get clang to target non-host is to pass -target.

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

Successfully merging this pull request may close these issues.

None yet

2 participants