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

fs: Add missing retarget definitions for ARM/IAR #5204

Merged
merged 1 commit into from Oct 6, 2017

Conversation

Projects
None yet
6 participants
@geky
Member

geky commented Sep 26, 2017

Currently code written for GCC may not work on ARM/IAR due to missing retarget definitions. This is manifested in littlefs/spiffs and may impact users.

  • missing O_ flags
  • missing S_IF flags
  • missing system types
  • missing stat structure
  • exhaustive list of errno codes

These were missing and causing tests written against the filesystem to fail. Tests are inbound for a later pr. Currently these definitions are available in GCC, but missing in ARM/IAR. This patch fixes that.

Note: Yes there are a bunch of errno codes that we may never use, but that just means we won't have to worry about naming errors for a while now.

@geky geky force-pushed the geky:fix-retarget-defs branch Sep 26, 2017

@geky geky added the needs: review label Sep 26, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 29, 2017

@kjbracey-arm

No objections, with only the passing note that the POSIX spec would like O_RDONLY to be a proper bit, despite historical implementations having it 0. I guess we want to match glibc though.

Where did the "exhaustive" errno list come from? POSIX or glibc or what?

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Sep 29, 2017

/morph test

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Sep 29, 2017

@geky Does this need anything more than a test?

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Sep 29, 2017

/morph test-nightly

1 similar comment
@mbed-bot

This comment has been minimized.

mbed-bot commented Sep 30, 2017

/morph test-nightly

@mbed-bot

This comment has been minimized.

mbed-bot commented Sep 30, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1456

Build failed!

@mbed-bot

This comment has been minimized.

mbed-bot commented Sep 30, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1456

Build failed!

Output

mbed Build Number: 1460

Build failed!

@mbed-bot

This comment has been minimized.

mbed-bot commented Sep 30, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1456

Build failed!

Output

mbed Build Number: 1460

Build failed!

Output

mbed Build Number: 1464

Build failed!

@mbed-bot

This comment has been minimized.

mbed-bot commented Oct 1, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1456

Build failed!

Output

mbed Build Number: 1460

Build failed!

Output

mbed Build Number: 1464

Build failed!

Output

mbed Build Number: 1468

Build failed!

@mbed-bot

This comment has been minimized.

mbed-bot commented Oct 1, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1456

Build failed!

Output

mbed Build Number: 1460

Build failed!

Output

mbed Build Number: 1464

Build failed!

Output

mbed Build Number: 1468

Build failed!

Output

mbed Build Number: 1472

Build failed!

@mbed-bot

This comment has been minimized.

mbed-bot commented Oct 1, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

 /morph test-nightly

Output

mbed Build Number: 1456

Build failed!

Output

mbed Build Number: 1460

Build failed!

Output

mbed Build Number: 1464

Build failed!

Output

mbed Build Number: 1468

Build failed!

Output

mbed Build Number: 1472

Build failed!

Output

mbed Build Number: 1476

Build failed!

@mbed-bot

This comment has been minimized.

mbed-bot commented Oct 2, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

  /morph test-nightly

Output

mbed Build Number: 1456

Build failed!

Output

mbed Build Number: 1460

Build failed!

Output

mbed Build Number: 1464

Build failed!

Output

mbed Build Number: 1468

Build failed!

Output

mbed Build Number: 1472

Build failed!

Output

mbed Build Number: 1476

Build failed!

Output

mbed Build Number: 1480

Build failed!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 2, 2017

@geky Please look at the failures (LocalFileSystem.cpp@272)

@0xc0170 0xc0170 added needs: work and removed needs: CI labels Oct 2, 2017

@theotherjimmy theotherjimmy changed the title from fs: Added in missing retarget definitions for ARM/IAR to fs: Add missing retarget definitions for ARM/IAR Oct 2, 2017

fs: Added in missing retarget definitions for ARM/IAR
- missing O_ flags
- missing S_IF flags
- missing system types
- missing stat structure
- exhaustive list of errno codes

@geky geky force-pushed the geky:fix-retarget-defs branch to e9cd239 Oct 2, 2017

@geky

This comment has been minimized.

Member

geky commented Oct 3, 2017

@0xc0170,Thanks for the line number

return type is not identical to nor covariant with return type "ssize_t"

Ah, that's why ssize_t was defined to int. The LocalFileSystem incorrectly uses int in its overload, as opposed to the ssize_t typedef. But if this breaks something in our codebase, it's probably safer to just keep the old typedef.

updated
/morph test-nightly

@mbed-bot

This comment has been minimized.

mbed-bot commented Oct 3, 2017

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1512

Build failed!

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Oct 5, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 5, 2017

/morph test-nightly

@mbed-bot

This comment has been minimized.

mbed-bot commented Oct 5, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1528

Build failed!

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Oct 5, 2017

/morph test-nightly

@geky

This comment has been minimized.

Member

geky commented Oct 5, 2017

@kjbracey-arm, sorry I missed your message under all the morph test outputs

I just stole the errno codes from lxr, though they're spread between a few files:
http://elixir.free-electrons.com/linux/v4.13/source/include/uapi/asm-generic/errno-base.h#L10
http://elixir.free-electrons.com/linux/v4.13/source/include/uapi/asm-generic/errno.h#L116

The O_RDONLY thing is noted, though yeah we're just aligning with glibc/newlib

@mbed-bot

This comment has been minimized.

mbed-bot commented Oct 6, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1536

All builds and test passed!

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Oct 6, 2017

@adbridge adbridge merged commit 7b2b18f into ARMmbed:master Oct 6, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-test-nightly Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment