Skip to contentSkip to conversation

Compiling files with .S with GCC

DISCUSSION Wiles, Keith 1 participant 1 message Apr 26, 2015

lore
Share & tools
lore
#0 lore raw

Hi All,

I noticed in my builds with foo.S file I would get a warning from the compiler the foo_s.o.tmp linker file will not be used as the code is not linked. A strange error and the foo_s.o file would not be created. In the mk/internal/rte.compile-pre.mk we have the following

# command to assemble a .S file to generate an object
ifeq ($(USE_HOST),1)
S_TO_O = $(CPP) $(HOST_CPPFLAGS) $($(@)_CPPFLAGS) $(HOST_EXTRA_CPPFLAGS)
$< $(@).tmp && \
    $(HOSTAS) $(HOST_ASFLAGS) $($(@)_ASFLAGS) $(HOST_EXTRA_ASFLAGS) -o $@
$(@).tmp
S_TO_O_STR = $(subst ','\'',$(S_TO_O)) #'# fix syntax highlight
S_TO_O_DISP =  $(if $(V),"$(S_TO_O_STR)","  HOSTAS $(@)")
else
S_TO_O = $(CPP) $(CPPFLAGS) $($(@)_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o
$(@).tmp && \
    $(AS) $(ASFLAGS) $($(@)_ASFLAGS) $(EXTRA_ASFLAGS) -o $@ $(@).tmp
S_TO_O_STR = $(subst ','\'',$(S_TO_O)) #'# fix syntax highlight
S_TO_O_DISP =  $(if $(V),"$(S_TO_O_STR)","  AS $(@)")
endif

I had to change the above Œ.tmp¹ strings to Œ.s¹ to remove this warning and get the foo_s.o file created. Using the .s the file name becomes foo_s.o.s

Did not try this with clang or any other compiler, but I expect we can safely change the Œ.tmp¹ to Œ.s¹ IMO

Anyone else notice this problem?

Regards,
++Keith