Sitelet https://github.com/micropython/micropython/issues/5500
Skip to content

Native modules don't compile on macOS for x64 / x86 arch #5500

Description

@stepansnigirev

I tried to compile the native module example (examples/natmod/feature0) on macOS and got the following error:

GEN build/features0.config.h
CC features0.c
LINK build/features0.o
Traceback (most recent call last):
  File "../../../tools/mpy_ld.py", line 964, in <module>
    main()
  File "../../../tools/mpy_ld.py", line 961, in main
    do_link(args)
  File "../../../tools/mpy_ld.py", line 937, in do_link
    load_object_file(env, file)
  File "../../../tools/mpy_ld.py", line 585, in load_object_file
    elf = elffile.ELFFile(f)
  File "/usr/local/lib/python3.7/site-packages/elftools/elf/elffile.py", line 67, in __init__
    self._identify_file()
  File "/usr/local/lib/python3.7/site-packages/elftools/elf/elffile.py", line 421, in _identify_file
    elf_assert(magic == b'\x7fELF', 'Magic number does not match')
  File "/usr/local/lib/python3.7/site-packages/elftools/common/utils.py", line 77, in elf_assert
    _assert_with_exception(cond, msg, ELFError)
  File "/usr/local/lib/python3.7/site-packages/elftools/common/utils.py", line 109, in _assert_with_exception
    raise exception_type(msg)
elftools.common.exceptions.ELFError: Magic number does not match
make: *** [build/features0.native.mpy] Error 1

On Ubuntu everything compiles. On Mac armv7m works, x86 and x64 - not.
I am using macOS Catalina v10.15.2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions