diff options
author | Arvind Sankar <[email protected]> | 2020-06-19 15:24:20 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2020-06-24 18:19:36 -0700 |
commit | 2989d1012ac00b4134a0dc490917e0b0d048d289 (patch) | |
tree | bf1be8175daedec6b6e5c4bb1c051f9f5eff0843 | |
parent | 109d2c93102049e7d7fdd5de7f9edff717224b32 (diff) |
Fix libspl/asm-generic/atomic for VPATH build
Currently, asm-generic/atomic.c is compiled into a .S file, with a
comment saying this is to simplify the upper-level Makefile.
However, this doesn't work properly with a VPATH build, which would
require better logic to deal with generated sources correctly.
It also doesn't seem more complex to just specify the .c/.S source file,
depending on the cpu, instead of only the source directory in
lib/libspl/Makefile.am, which eliminates the need to do the intermediate
compilation.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Arvind Sankar <[email protected]>
Closes #10493
-rw-r--r-- | lib/libspl/Makefile.am | 17 | ||||
-rw-r--r-- | lib/libspl/asm-generic/Makefile.am | 16 | ||||
-rw-r--r-- | lib/libspl/asm-i386/Makefile.am | 2 | ||||
-rw-r--r-- | lib/libspl/asm-x86_64/Makefile.am | 2 |
4 files changed, 8 insertions, 29 deletions
diff --git a/lib/libspl/Makefile.am b/lib/libspl/Makefile.am index 77d8aba0e..e11b165d7 100644 --- a/lib/libspl/Makefile.am +++ b/lib/libspl/Makefile.am @@ -1,20 +1,16 @@ include $(top_srcdir)/config/Rules.am if TARGET_CPU_I386 -TARGET_CPU_DIR = asm-i386 +TARGET_CPU_ATOMIC_SOURCE = asm-i386/atomic.S else if TARGET_CPU_X86_64 -TARGET_CPU_DIR = asm-x86_64 +TARGET_CPU_ATOMIC_SOURCE = asm-x86_64/atomic.S else -TARGET_CPU_DIR = asm-generic +TARGET_CPU_ATOMIC_SOURCE = asm-generic/atomic.c endif endif -VPATH = \ - $(top_srcdir)/lib/libspl \ - $(top_srcdir)/lib/libspl/$(TARGET_CPU_DIR) - -SUBDIRS = include $(TARGET_CPU_DIR) +SUBDIRS = include DIST_SUBDIRS = include asm-generic asm-i386 asm-x86_64 AM_CFLAGS += $(LIBTIRPC_CFLAGS) @@ -48,14 +44,11 @@ USER_C += \ os/freebsd/gethostid.c \ os/freebsd/getmntany.c \ os/freebsd/mnttab.c - endif -USER_ASM = atomic.S - nodist_libspl_la_SOURCES = \ $(USER_C) \ - $(USER_ASM) + $(TARGET_CPU_ATOMIC_SOURCE) libspl_la_LIBADD = -lrt $(LIBTIRPC_LIBS) diff --git a/lib/libspl/asm-generic/Makefile.am b/lib/libspl/asm-generic/Makefile.am index 396823160..1d5e224b1 100644 --- a/lib/libspl/asm-generic/Makefile.am +++ b/lib/libspl/asm-generic/Makefile.am @@ -1,15 +1 @@ -include $(top_srcdir)/config/Rules.am - -atomic_SOURCE = atomic.c -atomic_ASM = atomic.S - -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIC -EXTRA_DIST = $(atomic_SOURCE) - -# Generates assembly to simplify inclusion in ../Makefile.am -all-am: - $(COMPILE) -c -S $(atomic_SOURCE) -o $(atomic_ASM) - -clean-generic: - $(RM) $(atomic_ASM) +EXTRA_DIST = atomic.c diff --git a/lib/libspl/asm-i386/Makefile.am b/lib/libspl/asm-i386/Makefile.am index e1126102f..e954ec401 100644 --- a/lib/libspl/asm-i386/Makefile.am +++ b/lib/libspl/asm-i386/Makefile.am @@ -1 +1 @@ -noinst_HEADERS = atomic.S +EXTRA_DIST = atomic.S diff --git a/lib/libspl/asm-x86_64/Makefile.am b/lib/libspl/asm-x86_64/Makefile.am index e1126102f..e954ec401 100644 --- a/lib/libspl/asm-x86_64/Makefile.am +++ b/lib/libspl/asm-x86_64/Makefile.am @@ -1 +1 @@ -noinst_HEADERS = atomic.S +EXTRA_DIST = atomic.S |