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

Bugfix for compilation under macOS #415

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

basilfx
Copy link

@basilfx basilfx commented Sep 19, 2016

Under macOS, one may observe the following errors:

du: illegal option -- b
usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file ...]
-e  [LIBSIZE]
size: Unknown command line argument '-t'.  Try: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/size -help'
size: Did you mean '-A'?

This is due to:

  • du does not support -b under macOS. The same output can be emulated using stat -f%z
  • size does not obey the $(CROSS_COMPILE) variable and it also does not know -t. This is only the case using Xcode toolchain (not arm-gcc-embedded).

This is probably a bug report with a PR to point at the right direction. I'm no Makefile expert, so I think this could be improved.

@frederikvs
Copy link
Contributor

I don't really like the growth of our makefile, but I don't see any other way.

Just one thing : could you maybe change it so that there's only one ifeq ($(OS),Darwin) block?

@basilfx
Copy link
Author

basilfx commented Sep 22, 2016

Pushed another attempt/variant: this one also checks if you are using default size, which is not from GNU binutils but from Apple. In that case, it just drops the argument (similar output).

Does this looks better?

@frederikvs
Copy link
Contributor

Looks better to me :-)

However, I'm not a huge fan of the ifeq ($(SIZE),size), because you're just comparing the strings, so if I have my environment set with symlinks from size and gcc to the cross-compiler variants, then you won't catch that.

Maybe we could try asking for size --version, and making a decision based on that, though it'll for make even more code in the makefile...
Then again, I'm just wondering : does it make sense to compile on a mac without CROSS-COMPILE set? Under linux we can run as an application, using e.g. VDE or TUN/TAP, but I'm not sure if this works on mac. Do you have a specific use case where this makes sense?

@basilfx
Copy link
Author

basilfx commented Sep 23, 2016

My specific use case is RIOT-OS (#371). RIOT-OS has support for native (via GCC or CLang), which I currently use to develop the picoTCP port :-)

Let me see if I can come up with something for size. Will look at this tonight.

@mhagmajer
Copy link
Contributor

mhagmajer commented Dec 11, 2016

+1

@basilfx , any news here?

I've manually patched the Makefile and was able to build picotcp on MacOS. Would be great if this finds it way into the next release!

@basilfx
Copy link
Author

basilfx commented Dec 12, 2016

@mhagmajer Sorry, I haven't found a good solution yet, due to the lack of time (work-work).

@mhagmajer
Copy link
Contributor

See #461 and #462

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

3 participants