Changing typedefs from POSIX

Asked by Stefan Heinzmann on 2018-06-26

Hi,

is there a recommended way how to build the toolchain with a different choice of typedefs for some scalar types from POSIX?

Specifically, I would like off_t to have 64 bits, and ino_t to have 32 bits. I don't know where the changes should be made. Do the build scripts have to be changed for this?

Cheers
Stefan H.

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
2018-06-26
Last reply:
2018-06-26
Tejas Belagod (belagod-tejas) said : #1

Try defining when building your application with -DFILE_OFFSET_BITS=64. But, this will automatically set ino_t to ino64_t.

https://www.gnu.org/software/libc/manual/html_node/File-Positioning.html

https://www.gnu.org/software/libc/manual/html_node/Attribute-Meanings.html

But I dont know if that's what you're looking for...

I don't know if there's an easy way to set off_t and ino_t to two different values other than rebuilding the libs.

Hi Stefan,

I'm afraid you'll have to change the standard headers themselves and rebuild the toolchain (good news is scripts wouldn't need to be changed). off_t seems to be coming from src/newlib/newlib/libc/include/sys/_types.h from the root of our source tarball (after untarring newlib.tar.bz2). Try to change it in the installed tarball (arm-none-eabi/include/sys/_types.h from the directory where you installed the binary tarball) and see if that makes any difference in your compiled program. If yes, don't forget to rebuild the toolchain first (as some ABI will be using that type) before you actually start using it.

Can you help with this problem?

Provide an answer of your own, or ask Stefan Heinzmann for more information if necessary.

To post a message you must log in.