Skip to content

undefined reference to 'memset' on macOS/arm64 #4

Description

@aaroneiche

I'm not sure if its worth reopening issue #1 or just starting a new one, I'm running into a similar build error trying to build on an M1 MBP running Ventura (macOS 13.6.7)

Darwin Aarons-MacBook-Pro.local 22.6.0 Darwin Kernel Version 22.6.0: Mon Apr 22 20:49:37 PDT 2024; root:xnu-8796.141.3.705.2~1/RELEASE_ARM64_T6000 arm64

aeiche@Aarons-MacBook-Pro tiny_tris % make all
Building tiny_tris.elf ...
/opt/homebrew/Cellar/riscv-gnu-toolchain/main/lib/gcc/riscv64-unknown-elf/13.2.0/../../../../riscv64-unknown-elf/bin/ld: /var/folders/v8/dwyhdmqn68bf9f2rm974l_lw0000gn/T//cch3OBog.ltrans0.ltrans.o: in function `main':
/Users/aeiche/Documents/Personal/Electronics Projects/CH32V003-GameConsole/software/tiny_tris/tiny_tris.c:362:(.text.startup.main+0x46a): undefined reference to `memset'
collect2: error: ld returned 1 exit status
make: *** [tiny_tris.elf] Error 1

I added the following to the makefile to fix an environment compiling error:

ifeq ($(shell uname -m),arm64)
	LDFLAGS +=  -march=rv32imac -mabi=ilp32
endif

But otherwise the makefile is as it was.
I haven't been able to figure out a fix other than what's already addressed in issue #1. (and that's in the makefile already, obvious)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions