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

Problems with building plo for imxrt106x target on MacOS #40

Closed
MaciejPurski opened this issue Dec 4, 2020 · 8 comments · Fixed by #42
Closed

Problems with building plo for imxrt106x target on MacOS #40

MaciejPurski opened this issue Dec 4, 2020 · 8 comments · Fixed by #42

Comments

@MaciejPurski
Copy link
Contributor

There is a problem on MacOS related to arguments to stat command:
Screenshot 2020-12-04 at 10 46 06
MacOS uses BSD version of stat, which does not recognize the format parameter -c, which is present on GNU version. stat -c command is used in few places in phoenix-rtos-project:
Screenshot 2020-12-04 at 10 57 38

@agkaminski
Copy link
Member

agkaminski commented Dec 4, 2020

Perhaps we can change stat -c "%s" to du -b | cut -f1?

@MaciejPurski
Copy link
Contributor Author

Unfortunately, on MacOS option -b is not recognised. Here is the man:
https://www.unix.com/man-page/osx/1/du/

@agkaminski
Copy link
Member

agkaminski commented Dec 4, 2020

We could use $(((du $1 | cut -f1) * 512)) if we can accept rounding to full 512 byte blocks. @HBuczynski do we need exact size there?

@HBuczynski
Copy link
Contributor

The exact files size is not needed. The file size defines the end of the program in memory and is later passes on to kernel in syspage. In my opinion, we can accept to round to PAGE_SIZE, which is 512 bytes.

@agkaminski
Copy link
Member

It is a coincidence that PAGE_SIZE is also 512 bytes ;)

@gerard5
Copy link
Contributor

gerard5 commented Dec 4, 2020

Why not use "wc -c" as it is portable by all *nix, and will tell you the size in bytes.
$(wc -c < $1)

@kemonats
Copy link
Contributor

kemonats commented Dec 4, 2020

If the scripts are to be portable, in this case there are solutions:

  1. the simplest already proposed by gerard5
    wc -c < file
  2. using perl
    perl -E 'print -s $ARGV[0]' file
  3. using different options depending on the OS
    Linux stat -c %s
    Darwin stat -f %z
    e.g.
OS=$(uname)
case "$OS" in
     Darwin) 
        STAT_OPT=-f %z
        ;;
     Linux)
        STAT_OPT=-c %s
        ;;
     *)
        exit 1
        ;;
esac

and use

stat $STAT_OPT file

I have question for MaciejPurski:
How did you build: using docker or native toolchain?
.
For me, building stops at busybox issue #38

@MaciejPurski
Copy link
Contributor Author

MaciejPurski commented Dec 7, 2020

I have question for MaciejPurski:
How did you build: using docker or native toolchain?
.
For me, building stops at busybox issue #38

@kemonats, I was building it using the native toolchain for target armv7m7-imxrt106x.

nalajcie added a commit that referenced this issue Jul 8, 2021
* libphoenix 748b730...b014ded (8):
  > resolve_path: use dynamic allocation for path copy
  > mkdir: fix mkdir('/') being allowed in some filesystems
  > libc: fix canonicalize_path_name() usage
  > stdlib: implement realpath()
  > limits.h: specify per-arch PATH_MAX, NAME_MAX and SYMLOOP_MAX
  > include: increase the ARG_MAX value
  > include: apply clang-format for limits.h files
  > ci: add rootfs to artifacts

* phoenix-rtos-build 1733507...bb1cf46 (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-corelibs 4965e51...1d90314 (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-devices 05e2ba2...5fb979c (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-filesystems 30bcd13...bb3b64b (9):
  > dummyfs: fix dir nonexistent errno (EINVAL -> ENOTDIR)
  > ci: add rootfs to artifacts
  > ext2: fix fs->root filesystem object initialization (#40)
  > dummyfs: fix symlink creation
  > dummyfs: fix lookup errno (EINVAL -> ENOTDIR)
  > ext2: add symlink creation feature
  > ext2: fix getAttr::atType
  > jffs2: fix getAttr::atType
  > dummyfs: ext2: jffs2: return error from getAttr/setAttr

* phoenix-rtos-kernel a1d44c4...e94a7e4 (6):
  > ci: add rootfs to artifacts
  > posix: add key management sockets
  > threads: Print process name when asserting on corrupted ustack
  > ia32: Added missing memcmp implementation
  > riscv: Added missing memcmp implementation
  > proc: Added user stack canary

* phoenix-rtos-posixsrv b73ca05...ea28e90 (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-usb 29119fb...8f5d3cb (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-utils bac37b1...d30a104 (4):
  > psd: flashmng_checkRange() return value fix
  > ci: add rootfs to artifacts
  > psd: bad blocks pointer fix (broken by previous commit)
  > psd: bad blocks array fix

* plo e0114cb...0d2297a (3):
  > cmds/kernel.c: add finding ELF sections by name (#110)
  > ci: add rootfs to artifacts
  > Keep consistent defines naming scheme (#107)
nalajcie added a commit that referenced this issue Jul 8, 2021
* libphoenix 748b730...b014ded (8):
  > resolve_path: use dynamic allocation for path copy
  > mkdir: fix mkdir('/') being allowed in some filesystems
  > libc: fix canonicalize_path_name() usage
  > stdlib: implement realpath()
  > limits.h: specify per-arch PATH_MAX, NAME_MAX and SYMLOOP_MAX
  > include: increase the ARG_MAX value
  > include: apply clang-format for limits.h files
  > ci: add rootfs to artifacts

* phoenix-rtos-build 1733507...bb1cf46 (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-corelibs 4965e51...1d90314 (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-devices 05e2ba2...5fb979c (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-filesystems 30bcd13...bb3b64b (9):
  > dummyfs: fix dir nonexistent errno (EINVAL -> ENOTDIR)
  > ci: add rootfs to artifacts
  > ext2: fix fs->root filesystem object initialization (#40)
  > dummyfs: fix symlink creation
  > dummyfs: fix lookup errno (EINVAL -> ENOTDIR)
  > ext2: add symlink creation feature
  > ext2: fix getAttr::atType
  > jffs2: fix getAttr::atType
  > dummyfs: ext2: jffs2: return error from getAttr/setAttr

* phoenix-rtos-kernel a1d44c4...e94a7e4 (6):
  > ci: add rootfs to artifacts
  > posix: add key management sockets
  > threads: Print process name when asserting on corrupted ustack
  > ia32: Added missing memcmp implementation
  > riscv: Added missing memcmp implementation
  > proc: Added user stack canary

* phoenix-rtos-posixsrv b73ca05...ea28e90 (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-usb 29119fb...8f5d3cb (1):
  > ci: add rootfs to artifacts

* phoenix-rtos-utils bac37b1...d30a104 (4):
  > psd: flashmng_checkRange() return value fix
  > ci: add rootfs to artifacts
  > psd: bad blocks pointer fix (broken by previous commit)
  > psd: bad blocks array fix

* plo e0114cb...0d2297a (3):
  > cmds/kernel.c: add finding ELF sections by name (#110)
  > ci: add rootfs to artifacts
  > Keep consistent defines naming scheme (#107)
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 a pull request may close this issue.

5 participants