Fix Cygwin build with Windows native toolchain
PR #1450 broke the Cygwin build. Refer to Issue #1672.
The use of of logic like:
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcc.a}}"
fails when the Toolchain $(CC) is a native Windows toolchain. That is because the returned path is a Windows-style patch which cannot be handled by the make 'dir' command. Commit 4910d43ab0
reorganized a lot of definitions and replaced the correct code with the use of the limit make 'dir' command. The original code used the Bash dirname command which does not suffer from this limitation; it can handle both POSIX and Windows paths.
This was verified using the stm32f4discover:nsh toolchain with the Windows native ARM Embedded toolchain. That toolchain returns:
arm-none-eabi-gcc --print-file-name=libgcc.a
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/libgcc.a
This commit is contained in:
parent
91b52c38f9
commit
55a9172bc2
@ -98,14 +98,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}
|
||||
EXTRA_LIBPATHS += -L ${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}
|
||||
EXTRA_LIBPATHS += -L ${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += lsupc++
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}
|
||||
EXTRA_LIBPATHS += -L ${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}
|
||||
endif
|
||||
|
@ -93,14 +93,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -116,14 +116,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -153,14 +153,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -98,14 +98,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -141,14 +141,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -148,14 +148,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -66,14 +66,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -272,14 +272,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}
|
||||
EXTRA_LIBPATHS += -L ${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}
|
||||
EXTRA_LIBPATHS += -L ${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += lsupc++
|
||||
EXTRA_LIBPATHS += -L ${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}
|
||||
EXTRA_LIBPATHS += -L ${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}
|
||||
endif
|
||||
|
@ -103,14 +103,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -57,14 +57,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -83,14 +83,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -115,14 +115,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -96,14 +96,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
@ -70,14 +70,14 @@ OBJDUMP = $(CROSSDEV)objdump
|
||||
# Add the builtin library
|
||||
|
||||
EXTRA_LIBS += -lgcc
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
||||
|
||||
ifneq ($(CONFIG_LIBM),y)
|
||||
EXTRA_LIBS += -lm
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_LIBSUPCXX),y)
|
||||
EXTRA_LIBS += -lsupc++
|
||||
EXTRA_LIBPATHS += -L "${dir ${shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a}}"
|
||||
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user