The GCC prefix -Wl was ignored because the command line value has higher priority.
It ended in impossibilty for GCC to pass parameters to LD.
The prefixed value must override the command line one.
Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
comma := ,
LDLIBS := $(addprefix -Wl$(comma),$(LDLIBS))
LDFLAGS := $(addprefix -Wl$(comma),$(LDFLAGS))
-EXTRA_LDFLAGS := $(addprefix -Wl$(comma),$(EXTRA_LDFLAGS))
+override EXTRA_LDFLAGS := $(addprefix -Wl$(comma),$(EXTRA_LDFLAGS))
O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \
-Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDLIBS)
else
comma := ,
LDLIBS := $(addprefix -Wl$(comma),$(LDLIBS))
LDFLAGS := $(addprefix -Wl$(comma),$(LDFLAGS))
-EXTRA_LDFLAGS := $(addprefix -Wl$(comma),$(EXTRA_LDFLAGS))
+override EXTRA_LDFLAGS := $(addprefix -Wl$(comma),$(EXTRA_LDFLAGS))
O_TO_SO = $(CC) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
-shared -o $@ $(OBJS-y) $(LDLIBS)
else