Skip to contentSkip to conversation

Compiling files with .S with GCC

DISCUSSION Wiles, Keith 2 participants 5 messages Apr 26, 2015 – May 4, 2015 4 messages not in the archive

lore
Share & tools
lore
#0 lore raw
Quoted 23 lines · Keith

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
Quoted 3 lines

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

Compiler used on Ubuntu 14.04 'gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2'

Quoted 9 lines

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

A message that is not in the archive (sent off-list or not yet received): D1628250.1DEA5%[email protected]

#2 lore raw

Hello,

Quoted 27 lines · Keith
Quoted 23 lines · Keith

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
Quoted 11 lines
Quoted 3 lines

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

Compiler used on Ubuntu 14.04 'gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2'

Quoted 5 lines

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?

I tested a similar use-case and I don't reproduce the issue. I don't don't understand why replacing $(@).tmp by $(@).s would solve it.

The file $(@).tmp is used as a temporary file to store the preprocessed version of the $(@).s file. I agree that using the .s extension is not a bad choice (see below), but to me it is not the proper solution to your problem.

Quoted 1 line

From https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html

file.s
Assembler code.
file.S
file.sx
Assembler code that must be preprocessed.

Regards,
Olivier

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 41 lines · Olivier MATZ

Hello,

Quoted 38 lines · Keith
Quoted 27 lines · Keith

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
Quoted 3 lines

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

Compiler used on Ubuntu 14.04 'gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2'

Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

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?

I tested a similar use-case and I don't reproduce the issue. I don't don't understand why replacing $(@).tmp by $(@).s would solve it.

In the case I saw the compiler seemed to want the .s to under stand it was not some other type of file. Not sure why the error occurred in my external build. We can leave it using .tmp if you like, but I feel .s would have been the correct name for the file.

If you think it needs to be changed to .s then you can submit a patch or I can or just leave it along your option.

Regards,
++Keith

Quoted 16 lines

The file $(@).tmp is used as a temporary file to store the preprocessed version of the $(@).s file. I agree that using the .s extension is not a bad choice (see below), but to me it is not the proper solution to your problem.

From https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html

file.s
Assembler code.
file.S
file.sx
Assembler code that must be preprocessed.

Regards,
Olivier

A message that is not in the archive (sent off-list or not yet received): D16CD406.1EAA4%[email protected]

#6 lore raw
Quoted 50 lines · Keith
Quoted 46 lines · Olivier MATZ

Hello,

Quoted 42 lines · Keith
Quoted 27 lines · Keith

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
Quoted 3 lines

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

Compiler used on Ubuntu 14.04 'gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2'

Quoted 5 lines

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?

Quoted 8 lines
Quoted 3 lines

I tested a similar use-case and I don't reproduce the issue. I don't don't understand why replacing $(@).tmp by $(@).s would solve it.

In the case I saw the compiler seemed to want the .s to under stand it was not some other type of file. Not sure why the error occurred in my external build. We can leave it using .tmp if you like, but I feel .s would have been the correct name for the file.

Can you send a log of the error you've seen?
Can you reproduce it outside the dpdk framework by trying to assemble a file called foo.tmp?
This would show that the problem really comes from the extension of the file.

Quoted 3 lines

If you think it needs to be changed to .s then you can submit a patch or I can or just leave it along your option.

Until we really understand the cause of the issue, I don't think this should be changed. But I'm not opposed to change it if we have a good justification.

Regards,
Olivier

Quoted 20 lines

Regards,
++Keith

Quoted 16 lines

The file $(@).tmp is used as a temporary file to store the preprocessed version of the $(@).s file. I agree that using the .s extension is not a bad choice (see below), but to me it is not the proper solution to your problem.

From https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html

file.s
Assembler code.
file.S
file.sx
Assembler code that must be preprocessed.

Regards,
Olivier

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 65 lines · Olivier MATZ
Quoted 56 lines · Keith
Quoted 46 lines · Olivier MATZ

Hello,

Quoted 43 lines · Keith
Quoted 27 lines · Keith

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
Quoted 4 lines

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

Compiler used on Ubuntu 14.04 'gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2'

Quoted 5 lines

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

Quoted 5 lines
Quoted 1 line
Quoted 1 line

Anyone else notice this problem?

I tested a similar use-case and I don't reproduce the issue. I don't don't understand why replacing $(@).tmp by $(@).s would solve it.

Quoted 5 lines

In the case I saw the compiler seemed to want the .s to under stand it was
not some other type of file. Not sure why the error occurred in my external build. We can leave it using .tmp if you like, but I feel .s would have been the correct name for the file.

Quoted 5 lines

Can you send a log of the error you've seen?
Can you reproduce it outside the dpdk framework by trying to assemble a file called foo.tmp?
This would show that the problem really comes from the extension of the file.

OK will try, but out of town this week.

Quoted 37 lines
Quoted 6 lines

If you think it needs to be changed to .s then you can submit a patch or I
can or just leave it along your option.

Until we really understand the cause of the issue, I don't think this should be changed. But I'm not opposed to change it if we have a good justification.

Regards,
Olivier

Quoted 20 lines

Regards,
++Keith

Quoted 16 lines

The file $(@).tmp is used as a temporary file to store the preprocessed version of the $(@).s file. I agree that using the .s extension is not a bad choice (see below), but to me it is not the proper solution to your problem.

From https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html

file.s
Assembler code.
file.S
file.sx
Assembler code that must be preprocessed.

Regards,
Olivier