[DTrace-devel] [PATCH] Add support for building .S files into .o objects

Kris Van Hees kris.van.hees at oracle.com
Thu Aug 26 19:52:19 PDT 2021


On Thu, Aug 26, 2021 at 10:45:07PM -0400, Eugene Loh wrote:
> I don't understand the issues, but whatever...
>      Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> In particular, things were working for me.  That is, I could touch a .S 
> file and it'd get recompiled.

The problem was that a .S file was being compiled in to .S file.  Since the
output file is not being stored in the same directory as the source file that
practically was not causing an issue, but it is fundamentally wrong to have
a compiled object file have the .S extension.

> On 8/26/21 10:40 PM, Kris Van Hees wrote:
> > With the introduction of assembler source files (.S) for BPF code, to be
> > compiled into object files (.o), the obj-name macro in Makefunctions
> > needs to be extended to account for .S source files.
> >
> > Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> > ---
> >   Makefunctions | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Makefunctions b/Makefunctions
> > index 3f398577..3da4d4ae 100644
> > --- a/Makefunctions
> > +++ b/Makefunctions
> > @@ -14,7 +14,7 @@ current-dir = $(dir $(lastword $(MAKEFILE_LIST)))
> >   # given primary.  If called with an absolute pathname, return it unchanged.
> >   # Syntax: $(call *-name,primary,filename)
> >   
> > -obj-name = $(addprefix $(objdir)/$(subst /,-,$($(1)_DIR))-,$(subst /,-,$(2:.c=.o)))
> > +obj-name = $(addprefix $(objdir)/$(subst /,-,$($(1)_DIR))-,$(subst /,-,$(patsubst %.S,%.o,$(2:.c=.o))))
> >   src-name = $(if $(filter-out $(abspath $(2)),$(2)),$(addprefix $($(1)_DIR),$(2)),$(2))
> >   
> >   # Functions to generate the name of a header file and DOF object file for a
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list