On an x86-64 host, crash TARGET=ARM gets built with -m32 but sial
currently doesn't, leading to the .so not being loadable:
crash> extend extensions/sial.so
extend: ./extensions/sial.so: machine type mismatch: 62
extend: ./extensions/sial.so: not an ELF format object file
This patches fixes this by using TARGET_CFLAGS in the sial makefiles.
This should also take care of PPC64 which currently explicitly passes
-m64.
Rabin
diff --git a/extensions/libsial/Makefile b/extensions/libsial/Makefile
index b4f3732..76b555e 100644
--- a/extensions/libsial/Makefile
+++ b/extensions/libsial/Makefile
@@ -24,10 +24,7 @@ LDIRT = lex.sial.c lex.sialpp.c sial.tab.c sial.tab.h sialpp.tab.c
\
LIBDIR = /usr/lib
TARGETS = libsial.a
-CFLAGS += -O3 -g -fPIC
-ifeq ($(TARGET), PPC64)
- CFLAGS += -m64
-endif
+CFLAGS += -O3 -g -fPIC $(TARGET_CFLAGS)
CFILES = sial_util.c sial_node.c sial_var.c sial_func.c sial_str.c \
sial_op.c sial_num.c sial_stat.c sial_builtin.c sial_type.c \
diff --git a/extensions/sial.mk b/extensions/sial.mk
index f6be13f..8923786 100644
--- a/extensions/sial.mk
+++ b/extensions/sial.mk
@@ -9,11 +9,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-ifeq ($(TARGET), PPC64)
- TARGET_FLAGS = -D$(TARGET) -m64
-else
- TARGET_FLAGS = -D$(TARGET)
-endif
+TARGET_FLAGS = -D$(TARGET) $(TARGET_CFLAGS)
all:
@if [ -f /usr/bin/flex ] && [ -f /usr/bin/bison ]; then \