From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id AD517C666 for ; Mon, 4 May 2015 10:38:03 +0200 (CEST) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YpBxJ-0004vF-FP; Mon, 04 May 2015 10:42:29 +0200 Message-ID: <55472FE0.6010201@6wind.com> Date: Mon, 04 May 2015 10:37:52 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: "Wiles, Keith" , "dev@dpdk.org" References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] Compiling files with .S with GCC X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 08:38:03 -0000 Hello, On 04/26/2015 06:55 PM, Wiles, Keith wrote: > > > On 4/26/15, 11:53 AM, "Wiles, Keith" wrote: > >> 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 > > Compiler used on Ubuntu 14.04 'gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2' > >> >> 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. >>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