Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   build sial with TARGET_CFLAGS (http://www.linux-archive.org/crash-utility/648417-build-sial-target_cflags.html)

Rabin Vincent 03-24-2012 02:37 PM

build sial with TARGET_CFLAGS
 
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

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 03-26-2012 02:33 PM

build sial with TARGET_CFLAGS
 
Deferring to Luc Chouinard for his ACK.

Thanks,
Dave

----- Original Message -----
> 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
>
> --
>

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

"Luc Chouinard" 03-27-2012 11:12 AM

build sial with TARGET_CFLAGS
 
ACK.
This is the correct flow for these options.
If someone targeting ppc64 can verify that would be great.

> -----Original Message-----
> From: crash-utility-bounces@redhat.com [mailto:crash-utility-
> bounces@redhat.com] On Behalf Of Rabin Vincent
> Sent: Saturday, March 24, 2012 11:38 AM
> To: crash-utility@redhat.com
> Subject: [Crash-utility] [PATCH] build sial with TARGET_CFLAGS
>
> 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
>
> --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 03-27-2012 01:55 PM

build sial with TARGET_CFLAGS
 
----- Original Message -----
> ACK.
> This is the correct flow for these options.
> If someone targeting ppc64 can verify that would be great.

I'll provision a ppc64 machine and verify the patch for both
64- and 32-bit builds. Presuming that works, queued for crash-6.0.6.

Thanks,
Dave

>
> > -----Original Message-----
> > From: crash-utility-bounces@redhat.com [mailto:crash-utility-
> > bounces@redhat.com] On Behalf Of Rabin Vincent
> > Sent: Saturday, March 24, 2012 11:38 AM
> > To: crash-utility@redhat.com
> > Subject: [Crash-utility] [PATCH] build sial with TARGET_CFLAGS
> >
> > 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
> >
> > --
> > Crash-utility mailing list
> > Crash-utility@redhat.com
> > https://www.redhat.com/mailman/listinfo/crash-utility
>
> --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 03-27-2012 06:20 PM

build sial with TARGET_CFLAGS
 
----- Original Message -----
>
>
> ----- Original Message -----
> > ACK.
> > This is the correct flow for these options.
> > If someone targeting ppc64 can verify that would be great.
>
> I'll provision a ppc64 machine and verify the patch for both
> 64- and 32-bit builds. Presuming that works, queued for crash-6.0.6.
>
> Thanks,
> Dave

Well, as luck would have it, this patch does not work with 32-bit PPC:

$ make extensions
gcc -Wall -nostartfiles -shared -rdynamic -o dminfo.so dminfo.c -fPIC -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1
gcc -Wall -nostartfiles -shared -rdynamic -o echo.so echo.c -fPIC -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1
cd libsial && make
bison -psial -v -t -d sial.y
sial.y: conflicts: 252 shift/reduce, 20 reduce/reduce
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_util.o sial_util.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_node.o sial_node.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_var.o sial_var.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_func.o sial_func.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_str.o sial_str.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_op.o sial_op.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_num.o sial_num.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_stat.o sial_stat.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_builtin.o sial_builtin.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_type.o sial_type.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_case.o sial_case.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_api.o sial_api.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_member.o sial_member.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_alloc.o sial_alloc.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_define.o sial_define.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_input.o sial_input.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_print.o sial_print.c
bison -psialpp -v -t -d sialpp.y
sialpp.y: conflicts: 23 shift/reduce
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c sialpp.tab.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c sial.tab.c
flex -L -Psial -t sial.l > lex.sial.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c lex.sial.c
flex -Psialpp -t sialpp.l > lex.sialpp.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c lex.sialpp.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -o mkbaseop mkbaseop.c
./mkbaseop > baseops.c
cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c baseops.c
ar ccurl libsial.a sial_util.o sial_node.o sial_var.o sial_func.o sial_str.o sial_op.o sial_num.o sial_stat.o sial_builtin.o sial_type.o sial_case.o sial_api.o sial_member.o sial_alloc.o sial_define.o sial_input.o sial_print.o sialpp.tab.o sial.tab.o lex.sial.o lex.sialpp.o baseops.o
gcc -g -I.. -Ilibsial -I../gdb-7.3.1/bfd -I../gdb-7.3.1/include -I../gdb-7.3.1/gdb -I../gdb-7.3.1/gdb/config -I../gdb-7.3.1/gdb/common -I../gdb-7.3.1 -nostartfiles -shared -rdynamic -o sial.so sial.c -fPIC -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1 -Llibsial -lsial
sial.c:997:2: error: #error sial: Unkown ABI
sial.c: In function ‘_init’:
sial.c:1004: error: ‘SIAL_ABI’ undeclared (first use in this function)
sial.c:1004: error: (Each undeclared identifier is reported only once
sial.c:1004: error: for each function it appears in.)
make[4]: [sial.so] Error 1 (ignored)
gcc -Wall -I. -nostartfiles -shared -rdynamic -o snap.so snap.c -fPIC -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1
gcc -Wall -nostartfiles -shared -rdynamic -o trace.so trace.c -fPIC -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1
$

I don't suppose it's as easy as just adding an ABI_PPC #define here
in sial_api.h:

/* abi values */
#define ABI_MIPS 1
#define ABI_INTEL_X86 2
#define ABI_INTEL_IA 3
#define ABI_S390 4
#define ABI_S390X 5
#define ABI_PPC64 6

and setting SIAL_ABI to it here in sial.c?:

#ifdef i386
#define SIAL_ABI ABI_INTEL_X86
#else
#ifdef __ia64__
#define SIAL_ABI ABI_INTEL_IA
#else
#ifdef __x86_64__
#define SIAL_ABI ABI_INTEL_IA
#else
#ifdef __s390__
#define SIAL_ABI ABI_S390
#else
#ifdef __s390x__
#define SIAL_ABI ABI_S390X
#else
#ifdef PPC64
#define SIAL_ABI ABI_PPC64
#else
#error sial: Unkown ABI
#endif
#endif
#endif
#endif
#endif
#endif

And I'm not mistaken, SIAL_ABI is pretty much useless. Aside
from getting #define'd above, it's only used here:

sial_apiset(&icops, SIAL_ABI, sizeof(long ), 0);

and that function apparently ignores it entirely:

void
sial_apiset(apiops *o, int abi, int nbpw, int sign)
{
def_t *dt;

sial_ops=o?o:&nullops;
sial_setdefbtype(nbpw, sign);
/* get the pre defines and push them. */
dt=API_GETDEFS();
while(dt) {

sial_newmac(dt->name, dt->val, 0, 0, 1);
dt=dt->next;
}
/* add the sial define */
sial_newmac(sial_strdup("sial"), sial_strdup("1"), 0, 0, 1);
}

Or am I missing something?

But if I do add a new ABI_PPC #define, it builds, and shows this:

# file ./extensions/snap.so
./extensions/snap.so: ELF 32-bit MSB shared object, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 = 0x13676e75, with unknown capability 0x10000 = 0xb0401, not stripped
#

whereas the native PPC64 version shows this:

# file extensions/sial.so
extensions/sial.so: ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked, not stripped
#

And it doesn't load the 32-bit version:

crash> extend sial.so
extend: ./extensions/sial.so: not an ELF format object file
crash>

But that is probably a crash issue, because *none* of the extension
modules built as 32-bit PPC objects will load:

crash> extend snap.so
extend: ./extensions/snap.so: not an ELF format object file
crash> extend echo.so
extend: ./extensions/echo.so: not an ELF format object file
crash>

And "file" shows the additional baggage for them as well:

# file extensions/snap.so
extensions/snap.so: ELF 32-bit MSB shared object, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 = 0x13676e75, with unknown capability 0x10000 = 0xb0401, not stripped
#

So anyway, I'm going to leave the patch in place, wait for your
answer re: creating an API_PPC #define, and also look into the
reason behind the load failure.

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 03-27-2012 06:34 PM

build sial with TARGET_CFLAGS
 
----- Original Message -----
>
>
> ----- Original Message -----
> >
> >
> > ----- Original Message -----
> > > ACK.
> > > This is the correct flow for these options.
> > > If someone targeting ppc64 can verify that would be great.
> >
> > I'll provision a ppc64 machine and verify the patch for both
> > 64- and 32-bit builds. Presuming that works, queued for
> > crash-6.0.6.
> >
> > Thanks,
> > Dave
>
> Well, as luck would have it, this patch does not work with 32-bit
> PPC:
>
> $ make extensions
> gcc -Wall -nostartfiles -shared -rdynamic -o dminfo.so dminfo.c -fPIC
> -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1
> gcc -Wall -nostartfiles -shared -rdynamic -o echo.so echo.c -fPIC
> -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1
> cd libsial && make
> bison -psial -v -t -d sial.y
> sial.y: conflicts: 252 shift/reduce, 20 reduce/reduce
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_util.o
> sial_util.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_node.o
> sial_node.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_var.o
> sial_var.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_func.o
> sial_func.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_str.o
> sial_str.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_op.o
> sial_op.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_num.o
> sial_num.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_stat.o
> sial_stat.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> sial_builtin.o sial_builtin.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_type.o
> sial_type.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_case.o
> sial_case.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_api.o
> sial_api.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> sial_member.o sial_member.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> sial_alloc.o sial_alloc.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> sial_define.o sial_define.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> sial_input.o sial_input.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> sial_print.o sial_print.c
> bison -psialpp -v -t -d sialpp.y
> sialpp.y: conflicts: 23 shift/reduce
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c sialpp.tab.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c sial.tab.c
> flex -L -Psial -t sial.l > lex.sial.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c lex.sial.c
> flex -Psialpp -t sialpp.l > lex.sialpp.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c lex.sialpp.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -o mkbaseop
> mkbaseop.c
> ./mkbaseop > baseops.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c baseops.c
> ar ccurl libsial.a sial_util.o sial_node.o sial_var.o sial_func.o
> sial_str.o sial_op.o sial_num.o sial_stat.o sial_builtin.o
> sial_type.o sial_case.o sial_api.o sial_member.o sial_alloc.o
> sial_define.o sial_input.o sial_print.o sialpp.tab.o sial.tab.o
> lex.sial.o lex.sialpp.o baseops.o
> gcc -g -I.. -Ilibsial -I../gdb-7.3.1/bfd -I../gdb-7.3.1/include
> -I../gdb-7.3.1/gdb -I../gdb-7.3.1/gdb/config
> -I../gdb-7.3.1/gdb/common -I../gdb-7.3.1 -nostartfiles -shared
> -rdynamic -o sial.so sial.c -fPIC -DPPC -m32 -D_FILE_OFFSET_BITS=64
> -fPIC -DGDB_7_3_1 -Llibsial -lsial
> sial.c:997:2: error: #error sial: Unkown ABI
> sial.c: In function ‘_init’:
> sial.c:1004: error: ‘SIAL_ABI’ undeclared (first use in this
> function)
> sial.c:1004: error: (Each undeclared identifier is reported only once
> sial.c:1004: error: for each function it appears in.)
> make[4]: [sial.so] Error 1 (ignored)
> gcc -Wall -I. -nostartfiles -shared -rdynamic -o snap.so snap.c -fPIC
> -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1
> gcc -Wall -nostartfiles -shared -rdynamic -o trace.so trace.c -fPIC
> -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1
> $
>
> I don't suppose it's as easy as just adding an ABI_PPC #define here
> in sial_api.h:
>
> /* abi values */
> #define ABI_MIPS 1
> #define ABI_INTEL_X86 2
> #define ABI_INTEL_IA 3
> #define ABI_S390 4
> #define ABI_S390X 5
> #define ABI_PPC64 6
>
> and setting SIAL_ABI to it here in sial.c?:
>
> #ifdef i386
> #define SIAL_ABI ABI_INTEL_X86
> #else
> #ifdef __ia64__
> #define SIAL_ABI ABI_INTEL_IA
> #else
> #ifdef __x86_64__
> #define SIAL_ABI ABI_INTEL_IA
> #else
> #ifdef __s390__
> #define SIAL_ABI ABI_S390
> #else
> #ifdef __s390x__
> #define SIAL_ABI ABI_S390X
> #else
> #ifdef PPC64
> #define SIAL_ABI ABI_PPC64
> #else
> #error sial: Unkown ABI
> #endif
> #endif
> #endif
> #endif
> #endif
> #endif
>
> And I'm not mistaken, SIAL_ABI is pretty much useless. Aside
> from getting #define'd above, it's only used here:
>
> sial_apiset(&icops, SIAL_ABI, sizeof(long ), 0);
>
> and that function apparently ignores it entirely:
>
> void
> sial_apiset(apiops *o, int abi, int nbpw, int sign)
> {
> def_t *dt;
>
> sial_ops=o?o:&nullops;
> sial_setdefbtype(nbpw, sign);
> /* get the pre defines and push them. */
> dt=API_GETDEFS();
> while(dt) {
>
> sial_newmac(dt->name, dt->val, 0, 0, 1);
> dt=dt->next;
> }
> /* add the sial define */
> sial_newmac(sial_strdup("sial"), sial_strdup("1"), 0, 0, 1);
> }
>
> Or am I missing something?
>
> But if I do add a new ABI_PPC #define, it builds, and shows this:
>
> # file ./extensions/snap.so
> ./extensions/snap.so: ELF 32-bit MSB shared object, PowerPC or
> cisco 4500, version 1 (SYSV), dynamically linked, with unknown
> capability 0x41000000 = 0x13676e75, with unknown capability
> 0x10000 = 0xb0401, not stripped
> #
>
> whereas the native PPC64 version shows this:
>
> # file extensions/sial.so
> extensions/sial.so: ELF 64-bit MSB shared object, 64-bit PowerPC or
> cisco 7500, version 1 (SYSV), dynamically linked, not stripped
> #
>
> And it doesn't load the 32-bit version:
>
> crash> extend sial.so
> extend: ./extensions/sial.so: not an ELF format object file
> crash>
>
> But that is probably a crash issue, because *none* of the extension
> modules built as 32-bit PPC objects will load:
>
> crash> extend snap.so
> extend: ./extensions/snap.so: not an ELF format object file
> crash> extend echo.so
> extend: ./extensions/echo.so: not an ELF format object file
> crash>
>
> And "file" shows the additional baggage for them as well:
>
> # file extensions/snap.so
> extensions/snap.so: ELF 32-bit MSB shared object, PowerPC or cisco
> 4500, version 1 (SYSV), dynamically linked, with unknown
> capability 0x41000000 = 0x13676e75, with unknown capability
> 0x10000 = 0xb0401, not stripped
> #
>
> So anyway, I'm going to leave the patch in place, wait for your
> answer re: creating an API_PPC #define, and also look into the
> reason behind the load failure.

The load failure is a crash issue -- there was no EM_PPC case statement
existing in the is_shared_object() function. With that put in place, the
32-bit PPC extension modules can be loaded, and with the "ABI_PPC" patched
version sial_api.h and sial.c in place, the module loads OK:

crash> !file extensions/sial.so
extensions/sial.so: ELF 32-bit MSB shared object, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 = 0x13676e75, with unknown capability 0x10000 = 0xb0401, not stripped
crash> extend sial.so
Core LINUX_RELEASE == '3.2.0-rc3'
< Sial interpreter version 3.0 >
Loading sial commands from /usr/share/sial/crash:/root/.sial .... Done.
./extensions/sial.so: shared object loaded
crash>

So the question is whether the (useless?) API_PPC #define can
safely be added?

Thanks,
Dave




--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

"Luc Chouinard" 03-27-2012 07:04 PM

build sial with TARGET_CFLAGS
 
Yes - the ABI flag is useless and should be decommissioned.
For now, go ahead and create a ABI_PPC definition to get it to build.
I'll see if I can clean this up in the next round of fixes.

The intent was to change the alignment of structure members based on the target abi. There is little interest in runtime cross and the need to create types on the fly in Linux is non-existent if you have the -g dwarf info from vmlinux. It was more relevant in the days of Irix and how SGI released new kernels.


> -----Original Message-----
> From: Dave Anderson [mailto:anderson@redhat.com]
> Sent: Tuesday, March 27, 2012 2:20 PM
> To: Discussion list for crash utility usage, maintenance and development
> Cc: Luc Chouinard; rabin@rab.in
> Subject: Re: [Crash-utility] [PATCH] build sial with TARGET_CFLAGS
>
>
>
> ----- Original Message -----
> >
> >
> > ----- Original Message -----
> > > ACK.
> > > This is the correct flow for these options.
> > > If someone targeting ppc64 can verify that would be great.
> >
> > I'll provision a ppc64 machine and verify the patch for both
> > 64- and 32-bit builds. Presuming that works, queued for crash-6.0.6.
> >
> > Thanks,
> > Dave
>
> Well, as luck would have it, this patch does not work with 32-bit PPC:
>
> $ make extensions
> gcc -Wall -nostartfiles -shared -rdynamic -o dminfo.so dminfo.c -fPIC -DPPC -
> m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1 gcc -Wall -nostartfiles -
> shared -rdynamic -o echo.so echo.c -fPIC -DPPC -m32 -D_FILE_OFFSET_BITS=64
> -fPIC -DGDB_7_3_1 cd libsial && make bison -psial -v -t -d sial.y
> sial.y: conflicts: 252 shift/reduce, 20 reduce/reduce
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_util.o sial_util.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_node.o
> sial_node.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_var.o sial_var.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_func.o
> sial_func.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_str.o sial_str.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_op.o sial_op.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_num.o
> sial_num.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_stat.o sial_stat.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_builtin.o
> sial_builtin.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_type.o
> sial_type.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_case.o
> sial_case.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_api.o sial_api.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_member.o
> sial_member.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_alloc.o
> sial_alloc.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_define.o
> sial_define.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_input.o
> sial_input.c
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_print.o
> sial_print.c
> bison -psialpp -v -t -d sialpp.y
> sialpp.y: conflicts: 23 shift/reduce
> cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c sialpp.tab.c cc -O3 -g -
> fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c sial.tab.c flex -L -Psial -t sial.l >
> lex.sial.c cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c lex.sial.c flex -
> Psialpp -t sialpp.l > lex.sialpp.c cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -
> fPIC -c lex.sialpp.c cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -o
> mkbaseop mkbaseop.c ./mkbaseop > baseops.c cc -O3 -g -fPIC -m32 -
> D_FILE_OFFSET_BITS=64 -fPIC -c baseops.c ar ccurl libsial.a sial_util.o
> sial_node.o sial_var.o sial_func.o sial_str.o sial_op.o sial_num.o sial_stat.o
> sial_builtin.o sial_type.o sial_case.o sial_api.o sial_member.o sial_alloc.o
> sial_define.o sial_input.o sial_print.o sialpp.tab.o sial.tab.o lex.sial.o lex.sialpp.o
> baseops.o gcc -g -I.. -Ilibsial -I../gdb-7.3.1/bfd -I../gdb-7.3.1/include -I../gdb-
> 7.3.1/gdb -I../gdb-7.3.1/gdb/config -I../gdb-7.3.1/gdb/common -I../gdb-7.3.1 -
> nostartfiles -shared -rdynamic -o sial.so sial.c -fPIC -DPPC -m32 -
> D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1 -Llibsial -lsial
> sial.c:997:2: error: #error sial: Unkown ABI
> sial.c: In function ‘_init’:
> sial.c:1004: error: ‘SIAL_ABI’ undeclared (first use in this function)
> sial.c:1004: error: (Each undeclared identifier is reported only once
> sial.c:1004: error: for each function it appears in.)
> make[4]: [sial.so] Error 1 (ignored)
> gcc -Wall -I. -nostartfiles -shared -rdynamic -o snap.so snap.c -fPIC -DPPC -m32
> -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1 gcc -Wall -nostartfiles -shared -
> rdynamic -o trace.so trace.c -fPIC -DPPC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -
> DGDB_7_3_1 $
>
> I don't suppose it's as easy as just adding an ABI_PPC #define here in sial_api.h:
>
> /* abi values */
> #define ABI_MIPS 1
> #define ABI_INTEL_X86 2
> #define ABI_INTEL_IA 3
> #define ABI_S390 4
> #define ABI_S390X 5
> #define ABI_PPC64 6
>
> and setting SIAL_ABI to it here in sial.c?:
>
> #ifdef i386
> #define SIAL_ABI ABI_INTEL_X86
> #else
> #ifdef __ia64__
> #define SIAL_ABI ABI_INTEL_IA
> #else
> #ifdef __x86_64__
> #define SIAL_ABI ABI_INTEL_IA
> #else
> #ifdef __s390__
> #define SIAL_ABI ABI_S390
> #else
> #ifdef __s390x__
> #define SIAL_ABI ABI_S390X
> #else
> #ifdef PPC64
> #define SIAL_ABI ABI_PPC64
> #else
> #error sial: Unkown ABI
> #endif
> #endif
> #endif
> #endif
> #endif
> #endif
>
> And I'm not mistaken, SIAL_ABI is pretty much useless. Aside from getting
> #define'd above, it's only used here:
>
> sial_apiset(&icops, SIAL_ABI, sizeof(long ), 0);
>
> and that function apparently ignores it entirely:
>
> void
> sial_apiset(apiops *o, int abi, int nbpw, int sign)
> {
> def_t *dt;
>
> sial_ops=o?o:&nullops;
> sial_setdefbtype(nbpw, sign);
> /* get the pre defines and push them. */
> dt=API_GETDEFS();
> while(dt) {
>
> sial_newmac(dt->name, dt->val, 0, 0, 1);
> dt=dt->next;
> }
> /* add the sial define */
> sial_newmac(sial_strdup("sial"), sial_strdup("1"), 0, 0, 1);
> }
>
> Or am I missing something?
>
> But if I do add a new ABI_PPC #define, it builds, and shows this:
>
> # file ./extensions/snap.so
> ./extensions/snap.so: ELF 32-bit MSB shared object, PowerPC or cisco 4500,
> version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 =
> 0x13676e75, with unknown capability 0x10000 = 0xb0401, not stripped
> #
>
> whereas the native PPC64 version shows this:
>
> # file extensions/sial.so
> extensions/sial.so: ELF 64-bit MSB shared object, 64-bit PowerPC or cisco 7500,
> version 1 (SYSV), dynamically linked, not stripped #
>
> And it doesn't load the 32-bit version:
>
> crash> extend sial.so
> extend: ./extensions/sial.so: not an ELF format object file
> crash>
>
> But that is probably a crash issue, because *none* of the extension modules
> built as 32-bit PPC objects will load:
>
> crash> extend snap.so
> extend: ./extensions/snap.so: not an ELF format object file
> crash> extend echo.so
> extend: ./extensions/echo.so: not an ELF format object file
> crash>
>
> And "file" shows the additional baggage for them as well:
>
> # file extensions/snap.so
> extensions/snap.so: ELF 32-bit MSB shared object, PowerPC or cisco 4500,
> version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 =
> 0x13676e75, with unknown capability 0x10000 = 0xb0401, not stripped
> #
>
> So anyway, I'm going to leave the patch in place, wait for your answer re:
> creating an API_PPC #define, and also look into the reason behind the load
> failure.
>
> Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 03-27-2012 07:06 PM

build sial with TARGET_CFLAGS
 
----- Original Message -----
>
> Yes - the ABI flag is useless and should be decommissioned.
> For now, go ahead and create a ABI_PPC definition to get it to build.
> I'll see if I can clean this up in the next round of fixes.
>
> The intent was to change the alignment of structure members based on
> the target abi. There is little interest in runtime cross and the
> need to create types on the fly in Linux is non-existent if you have
> the -g dwarf info from vmlinux. It was more relevant in the days of
> Irix and how SGI released new kernels.

OK good -- I'll just add my hack-around for now.

Thanks,
Dave

>
> > -----Original Message-----
> > From: Dave Anderson [mailto:anderson@redhat.com]
> > Sent: Tuesday, March 27, 2012 2:20 PM
> > To: Discussion list for crash utility usage, maintenance and
> > development
> > Cc: Luc Chouinard; rabin@rab.in
> > Subject: Re: [Crash-utility] [PATCH] build sial with TARGET_CFLAGS
> >
> >
> >
> > ----- Original Message -----
> > >
> > >
> > > ----- Original Message -----
> > > > ACK.
> > > > This is the correct flow for these options.
> > > > If someone targeting ppc64 can verify that would be great.
> > >
> > > I'll provision a ppc64 machine and verify the patch for both
> > > 64- and 32-bit builds. Presuming that works, queued for
> > > crash-6.0.6.
> > >
> > > Thanks,
> > > Dave
> >
> > Well, as luck would have it, this patch does not work with 32-bit
> > PPC:
> >
> > $ make extensions
> > gcc -Wall -nostartfiles -shared -rdynamic -o dminfo.so dminfo.c
> > -fPIC -DPPC -
> > m32 -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1 gcc -Wall
> > -nostartfiles -
> > shared -rdynamic -o echo.so echo.c -fPIC -DPPC -m32
> > -D_FILE_OFFSET_BITS=64
> > -fPIC -DGDB_7_3_1 cd libsial && make bison -psial -v -t -d sial.y
> > sial.y: conflicts: 252 shift/reduce, 20 reduce/reduce
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_util.o sial_util.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_node.o
> > sial_node.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_var.o sial_var.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_func.o
> > sial_func.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_str.o sial_str.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o sial_op.o
> > sial_op.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_num.o
> > sial_num.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_stat.o sial_stat.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_builtin.o
> > sial_builtin.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_type.o
> > sial_type.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_case.o
> > sial_case.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_api.o sial_api.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_member.o
> > sial_member.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_alloc.o
> > sial_alloc.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_define.o
> > sial_define.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_input.o
> > sial_input.c
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c -o
> > sial_print.o
> > sial_print.c
> > bison -psialpp -v -t -d sialpp.y
> > sialpp.y: conflicts: 23 shift/reduce
> > cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c sialpp.tab.c
> > cc -O3 -g -
> > fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c sial.tab.c flex -L -Psial
> > -t sial.l >
> > lex.sial.c cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64 -fPIC -c
> > lex.sial.c flex -
> > Psialpp -t sialpp.l > lex.sialpp.c cc -O3 -g -fPIC -m32
> > -D_FILE_OFFSET_BITS=64 -
> > fPIC -c lex.sialpp.c cc -O3 -g -fPIC -m32 -D_FILE_OFFSET_BITS=64
> > -fPIC -o
> > mkbaseop mkbaseop.c ./mkbaseop > baseops.c cc -O3 -g -fPIC -m32 -
> > D_FILE_OFFSET_BITS=64 -fPIC -c baseops.c ar ccurl libsial.a
> > sial_util.o
> > sial_node.o sial_var.o sial_func.o sial_str.o sial_op.o sial_num.o
> > sial_stat.o
> > sial_builtin.o sial_type.o sial_case.o sial_api.o sial_member.o
> > sial_alloc.o
> > sial_define.o sial_input.o sial_print.o sialpp.tab.o sial.tab.o
> > lex.sial.o lex.sialpp.o
> > baseops.o gcc -g -I.. -Ilibsial -I../gdb-7.3.1/bfd
> > -I../gdb-7.3.1/include -I../gdb-
> > 7.3.1/gdb -I../gdb-7.3.1/gdb/config -I../gdb-7.3.1/gdb/common
> > -I../gdb-7.3.1 -
> > nostartfiles -shared -rdynamic -o sial.so sial.c -fPIC -DPPC -m32 -
> > D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1 -Llibsial -lsial
> > sial.c:997:2: error: #error sial: Unkown ABI
> > sial.c: In function ‘_init’:
> > sial.c:1004: error: ‘SIAL_ABI’ undeclared (first use in this
> > function)
> > sial.c:1004: error: (Each undeclared identifier is reported only
> > once
> > sial.c:1004: error: for each function it appears in.)
> > make[4]: [sial.so] Error 1 (ignored)
> > gcc -Wall -I. -nostartfiles -shared -rdynamic -o snap.so snap.c
> > -fPIC -DPPC -m32
> > -D_FILE_OFFSET_BITS=64 -fPIC -DGDB_7_3_1 gcc -Wall -nostartfiles
> > -shared -
> > rdynamic -o trace.so trace.c -fPIC -DPPC -m32
> > -D_FILE_OFFSET_BITS=64 -fPIC -
> > DGDB_7_3_1 $
> >
> > I don't suppose it's as easy as just adding an ABI_PPC #define here
> > in sial_api.h:
> >
> > /* abi values */
> > #define ABI_MIPS 1
> > #define ABI_INTEL_X86 2
> > #define ABI_INTEL_IA 3
> > #define ABI_S390 4
> > #define ABI_S390X 5
> > #define ABI_PPC64 6
> >
> > and setting SIAL_ABI to it here in sial.c?:
> >
> > #ifdef i386
> > #define SIAL_ABI ABI_INTEL_X86
> > #else
> > #ifdef __ia64__
> > #define SIAL_ABI ABI_INTEL_IA
> > #else
> > #ifdef __x86_64__
> > #define SIAL_ABI ABI_INTEL_IA
> > #else
> > #ifdef __s390__
> > #define SIAL_ABI ABI_S390
> > #else
> > #ifdef __s390x__
> > #define SIAL_ABI ABI_S390X
> > #else
> > #ifdef PPC64
> > #define SIAL_ABI ABI_PPC64
> > #else
> > #error sial: Unkown ABI
> > #endif
> > #endif
> > #endif
> > #endif
> > #endif
> > #endif
> >
> > And I'm not mistaken, SIAL_ABI is pretty much useless. Aside from
> > getting
> > #define'd above, it's only used here:
> >
> > sial_apiset(&icops, SIAL_ABI, sizeof(long ), 0);
> >
> > and that function apparently ignores it entirely:
> >
> > void
> > sial_apiset(apiops *o, int abi, int nbpw, int sign)
> > {
> > def_t *dt;
> >
> > sial_ops=o?o:&nullops;
> > sial_setdefbtype(nbpw, sign);
> > /* get the pre defines and push them. */
> > dt=API_GETDEFS();
> > while(dt) {
> >
> > sial_newmac(dt->name, dt->val, 0, 0, 1);
> > dt=dt->next;
> > }
> > /* add the sial define */
> > sial_newmac(sial_strdup("sial"), sial_strdup("1"), 0, 0,
> > 1);
> > }
> >
> > Or am I missing something?
> >
> > But if I do add a new ABI_PPC #define, it builds, and shows this:
> >
> > # file ./extensions/snap.so
> > ./extensions/snap.so: ELF 32-bit MSB shared object, PowerPC or
> > cisco 4500,
> > version 1 (SYSV), dynamically linked, with unknown capability
> > 0x41000000 =
> > 0x13676e75, with unknown capability 0x10000 = 0xb0401, not
> > stripped
> > #
> >
> > whereas the native PPC64 version shows this:
> >
> > # file extensions/sial.so
> > extensions/sial.so: ELF 64-bit MSB shared object, 64-bit PowerPC
> > or cisco 7500,
> > version 1 (SYSV), dynamically linked, not stripped #
> >
> > And it doesn't load the 32-bit version:
> >
> > crash> extend sial.so
> > extend: ./extensions/sial.so: not an ELF format object file
> > crash>
> >
> > But that is probably a crash issue, because *none* of the extension
> > modules
> > built as 32-bit PPC objects will load:
> >
> > crash> extend snap.so
> > extend: ./extensions/snap.so: not an ELF format object file
> > crash> extend echo.so
> > extend: ./extensions/echo.so: not an ELF format object file
> > crash>
> >
> > And "file" shows the additional baggage for them as well:
> >
> > # file extensions/snap.so
> > extensions/snap.so: ELF 32-bit MSB shared object, PowerPC or
> > cisco 4500,
> > version 1 (SYSV), dynamically linked, with unknown capability
> > 0x41000000 =
> > 0x13676e75, with unknown capability 0x10000 = 0xb0401, not stripped
> > #
> >
> > So anyway, I'm going to leave the patch in place, wait for your
> > answer re:
> > creating an API_PPC #define, and also look into the reason behind
> > the load
> > failure.
> >
> > Dave
>

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 09:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.