Skip to content

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

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

Merged
merged 1 commit into from
Oct 6, 2017

Conversation

geky
Copy link
Contributor

@geky 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.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 29, 2017

cc @kjbracey-arm @deepikabhavnani

Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

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

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
Copy link
Contributor

/morph test

@theotherjimmy
Copy link
Contributor

@geky Does this need anything more than a test?

@theotherjimmy
Copy link
Contributor

/morph test-nightly

1 similar comment
@mbed-bot
Copy link

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

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

/morph test-nightly

Output

mbed Build Number: 1456

Build failed!

@mbed-bot
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link
Contributor

0xc0170 commented Oct 2, 2017

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

@theotherjimmy theotherjimmy changed the title fs: Added in missing retarget definitions for ARM/IAR fs: Add missing retarget definitions for ARM/IAR Oct 2, 2017
- missing O_ flags
- missing S_IF flags
- missing system types
- missing stat structure
- exhaustive list of errno codes
@geky geky force-pushed the fix-retarget-defs branch from 7ea9811 to e9cd239 Compare October 2, 2017 21:12
@geky
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor

0xc0170 commented Oct 5, 2017

/morph test-nightly

@mbed-bot
Copy link

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
Copy link
Contributor

/morph test-nightly

@geky
Copy link
Contributor Author

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
Copy link

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!

@adbridge adbridge merged commit 7b2b18f into ARMmbed:master Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants