Skip to content

Cygwin GNU make link broken, ld: unrecognized option '-z' #9832

Open
@patacongo

Description

@patacongo

$ tools/configure.sh sim:nsh
$ make V=1

...
echo "LD:  nuttx.exe"
LD:  nuttx.exe
ld -r -z noexecstack -L"/cygdrive/d/Spuda/Documents/projects/nuttx/master/nuttx/staging" -L board   \
     -o nuttx.rel sim_head.o sim_doirq.o --start-group -lsched -ldrivers -lboards -lc -lmm -larch -lapps -lfs -lbinfmt -lboard  --end-group
ld: unrecognized option '-z'
ld: use the --help option for usage information
make[1]: *** [Makefile:362: nuttx.exe] Error 1
make[1]: Leaving directory '/cygdrive/d/Spuda/Documents/projects/nuttx/master/nuttx/arch/sim/src'
make: *** [tools/Unix.mk:527: nuttx.exe] Error 2

$ ld --version
GNU ld (GNU Binutils) 2.40

Per https://stackoverflow.com/questions/55418931/ld-exe-unrecognized-option-z

The -z options are just not supported for Windows versions of ld. Check with ld --help. For Cygwin, it should not list -z options that are present when running the same command on a Linux system. I believe this is because options here are really only meaningful on Linux.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions