* kerne-2.4.0-test13pre3 with gcc-2.97
@ 2000-12-23 5:52 Kaoru Fukui
[not found] ` <20001223142145.T5858@coruscant.gnumonks.org>
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Kaoru Fukui @ 2000-12-23 5:52 UTC (permalink / raw)
To: linuxppc-dev; +Cc: gcc
Hi !
I tried to compile kernel-2.4.0-test13-pre3 with gcc-2.97.
It need the patch.
The gcc-2.97 makes singleCPU work kernel well,
But the smp kernel didn't work.
The gcc-2.95.3 makes both work kernel , very well without this patch.
Does this kernel problems or gcc problems?
My system is linuxppc.
Kaoru
------ gcc --------
[root@g4mpKFUKUI kernel-single]# gcc -v
Reading specs from /usr/lib/gcc-lib/ppc-redhat-linux/2.97/specs
Configured with: /usr/src/redhat/BUILD/gcc-2.97/configure --prefix=/usr --enable-shared -
-enable-threads --host=ppc-redhat-linux --with-cpp-install-dir=../lib --enable-libstdcxx-v3
ppc-redhat-linux
gcc version 2.97 20001217 (experimental)
[root@g4mpKFUKUI kernel-single]#
----- patch for kernel-2.4.0-test13pre3 ---------
diff -urN base/linux/drivers/usb/audio.c fixed/linux/drivers/usb/audio.c
--- base/linux/drivers/usb/audio.c Fri Dec 22 13:47:44 2000
+++ fixed/linux/drivers/usb/audio.c Sat Dec 23 12:18:21 2000
@@ -788,7 +788,7 @@
{
union {
__s16 s[64];
- unsigned char b[0];
+ unsigned char *b;
} tmp;
unsigned int scnt, maxs, ufmtsh, dfmtsh;
@@ -1139,7 +1139,7 @@
{
union {
__s16 s[64];
- unsigned char b[0];
+ unsigned char *b;
} tmp;
unsigned int scnt, maxs, ufmtsh, dfmtsh;
diff -urN base/linux/drivers/video/aty128fb.c fixed/linux/drivers/video/aty128fb.c
--- base/linux/drivers/video/aty128fb.c Fri Dec 22 13:47:45 2000
+++ fixed/linux/drivers/video/aty128fb.c Sat Dec 23 10:09:02 2000
@@ -148,7 +148,7 @@
};
/* supported Rage128 chipsets */
-static const struct aty128_chip_info aty128_pci_probe_list[] __initdata =
+static const struct aty128_chip_info *aty128_pci_probe_list __initdata =
{
{"Rage128 RE (PCI)", PCI_DEVICE_ID_ATI_RAGE128_RE, rage_128},
{"Rage128 RF (AGP)", PCI_DEVICE_ID_ATI_RAGE128_RF, rage_128},
diff -urN base/linux/net/ipv4/netfilter/ip_nat_rule.c fixed/linux/net/ipv4/
netfilter/ip_nat_rule.c
--- base/linux/net/ipv4/netfilter/ip_nat_rule.c Fri Dec 22 13:48:22 2000
+++ fixed/linux/net/ipv4/netfilter/ip_nat_rule.c Sat Dec 23 10:47:59 2000
@@ -62,31 +62,31 @@
{ [NF_IP_PRE_ROUTING] 0,
[NF_IP_POST_ROUTING] sizeof(struct ipt_standard),
[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 2 },
- 0, NULL, { } },
+ 0, NULL },
{
/* PRE_ROUTING */
{ { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
0,
sizeof(struct ipt_entry),
sizeof(struct ipt_standard),
- 0, { 0, 0 }, { } },
- { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
+ 0, { 0, 0 } },
+ { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } } },
-NF_ACCEPT - 1 } },
/* POST_ROUTING */
{ { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
0,
sizeof(struct ipt_entry),
sizeof(struct ipt_standard),
- 0, { 0, 0 }, { } },
- { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
+ 0, { 0, 0 } },
+ { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } } },
-NF_ACCEPT - 1 } },
/* LOCAL_OUT */
{ { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
0,
sizeof(struct ipt_entry),
sizeof(struct ipt_standard),
- 0, { 0, 0 }, { } },
- { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
+ 0, { 0, 0 } },
+ { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } } },
-NF_ACCEPT - 1 } }
},
/* ERROR */
@@ -94,9 +94,8 @@
0,
sizeof(struct ipt_entry),
sizeof(struct ipt_error),
- 0, { 0, 0 }, { } },
- { { { { IPT_ALIGN(sizeof(struct ipt_error_target)), IPT_ERROR_TARGET }
},
- { } },
+ 0, { 0, 0 } },
+ { { { { IPT_ALIGN(sizeof(struct ipt_error_target)), IPT_ERROR_TARGET }
} },
"ERROR"
}
}
diff -urN base/linux/net/ipv4/netfilter/ip_tables.c fixed/linux/net/ipv4/netfilter/
ip_tables.c
--- base/linux/net/ipv4/netfilter/ip_tables.c Fri Dec 22 13:48:22 2000
+++ fixed/linux/net/ipv4/netfilter/ip_tables.c Sat Dec 23 10:33:10 2000
@@ -1358,7 +1358,7 @@
int ret;
struct ipt_table_info *newinfo;
static struct ipt_table_info bootstrap
- = { 0, 0, { 0 }, { 0 }, { } };
+ = { 0, 0, { 0 }, { 0 }, {0} };
MOD_INC_USE_COUNT;
newinfo = vmalloc(sizeof(struct ipt_table_info)
diff -urN base/linux/net/ipv4/netfilter/iptable_filter.c fixed/linux/net/ipv4/
netfilter/iptable_filter.c
--- base/linux/net/ipv4/netfilter/iptable_filter.c Fri Dec 22 13:48:22 2000
+++ fixed/linux/net/ipv4/netfilter/iptable_filter.c Sat Dec 23 10:44:56 2000
@@ -41,31 +41,31 @@
{ [NF_IP_LOCAL_IN] 0,
[NF_IP_FORWARD] sizeof(struct ipt_standard),
[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) * 2 },
- 0, NULL, { } },
+ 0, NULL },
{
/* LOCAL_IN */
{ { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
0,
sizeof(struct ipt_entry),
sizeof(struct ipt_standard),
- 0, { 0, 0 }, { } },
- { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
+ 0, { 0, 0 } },
+ { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } } },
-NF_ACCEPT - 1 } },
/* FORWARD */
{ { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
0,
sizeof(struct ipt_entry),
sizeof(struct ipt_standard),
- 0, { 0, 0 }, { } },
- { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
+ 0, { 0, 0 } },
+ { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } } },
-NF_ACCEPT - 1 } },
/* LOCAL_OUT */
{ { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
0,
sizeof(struct ipt_entry),
sizeof(struct ipt_standard),
- 0, { 0, 0 }, { } },
- { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
+ 0, { 0, 0 } },
+ { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } } },
-NF_ACCEPT - 1 } }
},
/* ERROR */
@@ -73,9 +73,8 @@
0,
sizeof(struct ipt_entry),
sizeof(struct ipt_error),
- 0, { 0, 0 }, { } },
- { { { { IPT_ALIGN(sizeof(struct ipt_error_target)), IPT_ERROR_TARGET }
},
- { } },
+ 0, { 0, 0 } },
+ { { { { IPT_ALIGN(sizeof(struct ipt_error_target)), IPT_ERROR_TARGET }
} },
"ERROR"
}
}
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
[not found] ` <20001223142145.T5858@coruscant.gnumonks.org>
@ 2000-12-23 13:30 ` Kaoru Fukui
0 siblings, 0 replies; 13+ messages in thread
From: Kaoru Fukui @ 2000-12-23 13:30 UTC (permalink / raw)
To: Harald Welte; +Cc: gcc, linuxppc-dev
From: Harald Welte <laforge@gnumonks.org>
To: Kaoru Fukui <k_fukui@highway.ne.jp>
Subject: Re: kerne-2.4.0-test13pre3 with gcc-2.97
Date: Sat, 23 Dec 2000 14:21:45 +0100
> On Sat, Dec 23, 2000 at 02:52:58PM +0900, Kaoru Fukui wrote:
> >
> > Hi !
> >
> > I tried to compile kernel-2.4.0-test13-pre3 with gcc-2.97.
> > It need the patch.
> > The gcc-2.97 makes singleCPU work kernel well,
> > But the smp kernel didn't work.
> >
> > The gcc-2.95.3 makes both work kernel , very well without this patch.
> >
> > Does this kernel problems or gcc problems?
>
> please think before you write. it is a well-known fact that the linux kernel
> - regardless of the target plattform - should be compiled with gcc 2.95.2
or
> less.
>
> and please don't take up the time of gcc or linuxppc developers by asking
> this kind of questions. Go ask other users.
Don't say the answer.
We should fix problems both or earch.
My focus is not Question.
New gcc doesn't compile new kernel.
It's no good.
Kaoru
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
2000-12-23 5:52 kerne-2.4.0-test13pre3 with gcc-2.97 Kaoru Fukui
[not found] ` <20001223142145.T5858@coruscant.gnumonks.org>
@ 2000-12-24 3:29 ` Alexandre Oliva
2000-12-24 13:53 ` Kaoru Fukui
2000-12-24 15:19 ` Thomas Sailer
2000-12-24 15:16 ` Thomas Sailer
2 siblings, 2 replies; 13+ messages in thread
From: Alexandre Oliva @ 2000-12-24 3:29 UTC (permalink / raw)
To: Kaoru Fukui; +Cc: linuxppc-dev, gcc
On Dec 23, 2000, Kaoru Fukui <k_fukui@highway.ne.jp> wrote:
> - unsigned char b[0];
> + unsigned char *b;
This change (and apparently all other changes you've made) are
definitely wrong. Zero-sized arrays as the last element of a
structure used to be an extension in GCC 2.95.2, that has been adopted
by C99 with a slightly different syntax, that GCC CVS supports: just
remove the `0' from between the braces.
With your change, you're changing what is supposed to be a structure
whose last element is a flexible array with a structure that ends with
a pointer to such an array, which means the array should be allocated
separately, and any access to it must de-reference an additional
pointer. You'd have to adjust all uses of such a pointer to make this
change. Could this be the reason why your modified kernel doesn't
work?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
2000-12-24 3:29 ` Alexandre Oliva
@ 2000-12-24 13:53 ` Kaoru Fukui
2000-12-24 15:20 ` Thomas Sailer
2000-12-24 15:19 ` Thomas Sailer
1 sibling, 1 reply; 13+ messages in thread
From: Kaoru Fukui @ 2000-12-24 13:53 UTC (permalink / raw)
To: Alexandre Oliva; +Cc: gcc, linuxppc-dev
From: Alexandre Oliva <aoliva@redhat.com>
To: Kaoru Fukui <k_fukui@highway.ne.jp>
Subject: Re: kerne-2.4.0-test13pre3 with gcc-2.97
Date: 24 Dec 2000 01:29:32 -0200
Cc: <linuxppc-dev@lists.linuxppc.org>, <gcc@gcc.gnu.org>
>
> On Dec 23, 2000, Kaoru Fukui <k_fukui@highway.ne.jp> wrote:
>
> > - unsigned char b[0];
> > + unsigned char *b;
>
> This change (and apparently all other changes you've made) are
> definitely wrong. Zero-sized arrays as the last element of a
> structure used to be an extension in GCC 2.95.2, that has been adopted
> by C99 with a slightly different syntax, that GCC CVS supports: just
> remove the `0' from between the braces.
>
> With your change, you're changing what is supposed to be a structure
> whose last element is a flexible array with a structure that ends with
> a pointer to such an array, which means the array should be allocated
> separately, and any access to it must de-reference an additional
> pointer. You'd have to adjust all uses of such a pointer to make this
> change. Could this be the reason why your modified kernel doesn't
> work?
Thanks Alex your explain.
I tried this
- unsigned char b[0];
+ unsigned char b[];
It gave me Inetrnal error: Segmentaion fault .
I had success compileing for the kernel with my patch.
I don't understand how do I do untill.
Thanks
Kaoru
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
2000-12-23 5:52 kerne-2.4.0-test13pre3 with gcc-2.97 Kaoru Fukui
[not found] ` <20001223142145.T5858@coruscant.gnumonks.org>
2000-12-24 3:29 ` Alexandre Oliva
@ 2000-12-24 15:16 ` Thomas Sailer
2 siblings, 0 replies; 13+ messages in thread
From: Thomas Sailer @ 2000-12-24 15:16 UTC (permalink / raw)
To: Kaoru Fukui; +Cc: linuxppc-dev, gcc
Kaoru Fukui wrote:
> The gcc-2.97 makes singleCPU work kernel well,
> But the smp kernel didn't work.
> diff -urN base/linux/drivers/usb/audio.c fixed/linux/drivers/usb/audio.c
> --- base/linux/drivers/usb/audio.c Fri Dec 22 13:47:44 2000
> +++ fixed/linux/drivers/usb/audio.c Sat Dec 23 12:18:21 2000
> @@ -788,7 +788,7 @@
> {
> union {
> __s16 s[64];
> - unsigned char b[0];
> + unsigned char *b;
> } tmp;
> unsigned int scnt, maxs, ufmtsh, dfmtsh;
>
> @@ -1139,7 +1139,7 @@
> {
> union {
> __s16 s[64];
> - unsigned char b[0];
> + unsigned char *b;
> } tmp;
> unsigned int scnt, maxs, ufmtsh, dfmtsh;
>
This patch is completely bogus. I do not believe you tested these
code paths, it just cannot work that way.
Tom
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
2000-12-24 3:29 ` Alexandre Oliva
2000-12-24 13:53 ` Kaoru Fukui
@ 2000-12-24 15:19 ` Thomas Sailer
2000-12-24 18:08 ` Alexandre Oliva
1 sibling, 1 reply; 13+ messages in thread
From: Thomas Sailer @ 2000-12-24 15:19 UTC (permalink / raw)
To: Alexandre Oliva; +Cc: Kaoru Fukui, linuxppc-dev, gcc
Alexandre Oliva wrote:
>
> On Dec 23, 2000, Kaoru Fukui <k_fukui@highway.ne.jp> wrote:
>
> > - unsigned char b[0];
> > + unsigned char *b;
>
> This change (and apparently all other changes you've made) are
> definitely wrong. Zero-sized arrays as the last element of a
> structure used to be an extension in GCC 2.95.2, that has been adopted
> by C99 with a slightly different syntax, that GCC CVS supports: just
> remove the `0' from between the braces.
Which is not backward compatible, unfortunately. So the
backward compatible fix would be "unsigned char b[1];".
Tom
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
2000-12-24 13:53 ` Kaoru Fukui
@ 2000-12-24 15:20 ` Thomas Sailer
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Sailer @ 2000-12-24 15:20 UTC (permalink / raw)
To: Kaoru Fukui; +Cc: Alexandre Oliva, gcc, linuxppc-dev
Kaoru Fukui wrote:
>
> I tried this
>
> - unsigned char b[0];
> + unsigned char b[];
>
> It gave me Inetrnal error: Segmentaion fault .
Not good.
> I had success compileing for the kernel with my patch.
You had success _compiling_ the code, but not _running_ it.
Use b[1] instead.
Tom
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
2000-12-24 15:19 ` Thomas Sailer
@ 2000-12-24 18:08 ` Alexandre Oliva
2000-12-26 1:41 ` how to use macro in assemble language embedded in C? kerler
2000-12-27 23:37 ` kerne-2.4.0-test13pre3 with gcc-2.97 Richard Henderson
0 siblings, 2 replies; 13+ messages in thread
From: Alexandre Oliva @ 2000-12-24 18:08 UTC (permalink / raw)
To: sailer; +Cc: Kaoru Fukui, linuxppc-dev, gcc
On Dec 24, 2000, Thomas Sailer <sailer@ife.ee.ethz.ch> wrote:
> Alexandre Oliva wrote:
>> This change (and apparently all other changes you've made) are
>> definitely wrong. Zero-sized arrays as the last element of a
>> structure used to be an extension in GCC 2.95.2, that has been adopted
>> by C99 with a slightly different syntax, that GCC CVS supports: just
>> remove the `0' from between the braces.
> Which is not backward compatible, unfortunately.
Indeed. I wish we had maintained the old syntax for
backward-compatibility, even if with a deprecation warning.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
@ 2000-12-25 0:04 Kaoru Fukui
0 siblings, 0 replies; 13+ messages in thread
From: Kaoru Fukui @ 2000-12-25 0:04 UTC (permalink / raw)
To: Alexandre Oliva, sailer; +Cc: linuxppc-dev, gcc
Thanks,Alex and Tom.
I have done kernel compiling with the patch.
it boot ,but unstable.
I will wait gcc-3.0.
Thanks a lot.
Kaoru
-----------------------
diff -urN base/linux/drivers/usb/audio.c fixed/linux/drivers/usb/audio.c
--- base/linux/drivers/usb/audio.c Fri Dec 22 13:47:44 2000
+++ fixed/linux/drivers/usb/audio.c Mon Dec 25 04:31:59 2000
@@ -788,7 +788,7 @@
{
union {
__s16 s[64];
- unsigned char b[0];
+ unsigned char b[1];
} tmp;
unsigned int scnt, maxs, ufmtsh, dfmtsh;
@@ -1139,7 +1139,7 @@
{
union {
__s16 s[64];
- unsigned char b[0];
+ unsigned char b[1];
} tmp;
unsigned int scnt, maxs, ufmtsh, dfmtsh;
diff -urN base/linux/drivers/video/aty128fb.c fixed/linux/drivers/video/aty128fb.c
--- base/linux/drivers/video/aty128fb.c Fri Dec 22 13:47:45 2000
+++ fixed/linux/drivers/video/aty128fb.c Mon Dec 25 05:02:21 2000
@@ -148,7 +148,7 @@
};
/* supported Rage128 chipsets */
-static const struct aty128_chip_info aty128_pci_probe_list[] __initdata =
+static const struct aty128_chip_info aty128_pci_probe_list[] =
{
{"Rage128 RE (PCI)", PCI_DEVICE_ID_ATI_RAGE128_RE, rage_128},
{"Rage128 RF (AGP)", PCI_DEVICE_ID_ATI_RAGE128_RF, rage_128},
diff -urN base/linux/include/linux/netfilter_ipv4/ip_tables.h fixed/linux/include/
linux/netfilter_ipv4/ip_tables.h
--- base/linux/include/linux/netfilter_ipv4/ip_tables.h Mon Dec 25 05:15:00
2000
+++ fixed/linux/include/linux/netfilter_ipv4/ip_tables.h Mon Dec 25 05:30:22
2000
@@ -65,7 +65,7 @@
u_int16_t match_size;
} u;
- unsigned char data[0];
+ unsigned char data[1];
};
struct ipt_entry_target
@@ -88,7 +88,7 @@
u_int16_t target_size;
} u;
- unsigned char data[0];
+ unsigned char data[1];
};
struct ipt_standard_target
@@ -138,7 +138,7 @@
struct ipt_counters counters;
/* The matches (if any), then the target. */
- unsigned char elems[0];
+ unsigned char elems[1];
};
/*
@@ -255,7 +255,7 @@
struct ipt_counters *counters;
/* The entries (hang off end: not really an array). */
- struct ipt_entry entries[0];
+ struct ipt_entry entries[1];
};
/* The argument to IPT_SO_ADD_COUNTERS. */
@@ -267,7 +267,7 @@
unsigned int num_counters;
/* The counters (actually `number' of these). */
- struct ipt_counters counters[0];
+ struct ipt_counters counters[1];
};
/* The argument to IPT_SO_GET_ENTRIES. */
@@ -280,7 +280,7 @@
unsigned int size;
/* The entries. */
- struct ipt_entry entrytable[0];
+ struct ipt_entry entrytable[1];
};
/* Standard return verdict, or do jump. */
diff -urN base/linux/net/ipv4/netfilter/ip_tables.c fixed/linux/net/ipv4/netfilter/
ip_tables.c
--- base/linux/net/ipv4/netfilter/ip_tables.c Fri Dec 22 13:48:22 2000
+++ fixed/linux/net/ipv4/netfilter/ip_tables.c Mon Dec 25 05:46:05 2000
@@ -90,7 +90,7 @@
unsigned int underflow[NF_IP_NUMHOOKS];
/* ipt_entry tables: one per CPU */
- char entries[0] __attribute__((aligned(SMP_CACHE_BYTES)));
+ char entries[1] __attribute__((aligned(SMP_CACHE_BYTES)));
};
static LIST_HEAD(ipt_target);
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* how to use macro in assemble language embedded in C?
2000-12-24 18:08 ` Alexandre Oliva
@ 2000-12-26 1:41 ` kerler
[not found] ` <20001226221757.Postino-028251@smtp01.highway.ne.jp>
2000-12-27 23:37 ` kerne-2.4.0-test13pre3 with gcc-2.97 Richard Henderson
1 sibling, 1 reply; 13+ messages in thread
From: kerler @ 2000-12-26 1:41 UTC (permalink / raw)
To: linuxppc-dev; +Cc: gcc
hello,
When i use the assemble language embedded in C, how can i use the macro?
in the following code, i want to use the macro PT_R16 defined in
asm\ptrace.h.
=========temp.c==========
asm("#include <asm\\ptrace.h>\n\t");
void dummy (void)
{
asm("stwu %r1, -PT_R16(%r1)"); /* stack */
}
=========end of temp.c===
when i
gcc -c temp.c
error message:
/tmp/cc8ztvPf.s: Assembler messages:
/tmp/cc8ztvPf.s:13: Error: Negative of non-absolute symbol PT_R16
if use
gcc -S temp.c
the file temp.s is:
=========temp.s==========
.file "temp.c"
gcc2_compiled.:
#include <asm\ptrace.h>
.section ".text"
.align 2
.globl dummy
.type dummy,@function
dummy:
stwu 1,-16(1)
stw 31,12(1)
mr 31,1
stwu %r1, -PT_R16(%r1)
.L2:
lwz 11,0(1)
lwz 31,-4(11)
mr 1,11
blr
.Lfe1:
.size dummy,.Lfe1-dummy
.ident "GCC: (GNU) 2.95.2 20000220 (Debian GNU/Linux)"
======end of temp.s=============
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: how to use macro in assemble language embedded in C?
[not found] ` <20001226221757.Postino-028251@smtp01.highway.ne.jp>
@ 2000-12-27 3:33 ` kerler
2000-12-27 15:50 ` Alexandre Oliva
0 siblings, 1 reply; 13+ messages in thread
From: kerler @ 2000-12-27 3:33 UTC (permalink / raw)
To: Kaoru Fukui; +Cc: gcc, linuxppc-dev
Hi,
(NOTE: when reply this mail, please cc: kerler@newmail.net , thanks)
I change the first line of temp.c:
asm("#include <asm\\ptrace.h>\n\t");
to
asm("#include <asm/ptrace.h>\n\t");
==========temp.c==================
asm("#include <asm/ptrace.h>\n\t");
void dummy (void)
{
asm("stwu %r1, -PT_R16(%r1)"); /* stack */
}
==========end of temp.c===========
failed when:
gcc -c temp.c
error message:
/tmp/cc06t5DZ.s: Assembler messages:
/tmp/cc06t5DZ.s:13: Error: Negative of non-absolute symbol PT_R16
but when use:
gcc -S temp.c -o temp.S (note: here is temp.S, not temp.s)
gcc -c -D_ASSEMBLY__ temp.S
success!
so I know the question is that gcc do pre-process when "gcc -c temp.S",
but not do per-process when "gcc -c temp.s"
so if i want use only one command line to compile temp.c,
such as "gcc -c -other-option temp.c", which other-option should I add to
make
gcc creat a temporal assemble file /tmp/xxxx.S (not /tmp/xxxx.s) ?
----- Original Message -----
From: Kaoru Fukui <k_fukui@highway.ne.jp>
To: kerler <kerler@newmail.net>
Sent: Tuesday, December 26, 2000 9:17 PM
Subject: Re: how to use macro in assemble language embedded in C?
> Hi!
>
> Look at linux/arch/kernel/entry.S or else
>
> Kaoru
>
>
> From: "kerler" <kerler@newmail.net>
> To: <linuxppc-dev@lists.linuxppc.org>
> Subject: how to use macro in assemble language embedded in C?
> Date: Tue, 26 Dec 2000 09:41:09 +0800
> Cc: <gcc@gcc.gnu.org>
>
> >
> > hello,
> >
> > When i use the assemble language embedded in C, how can i use the macro?
> >
> > in the following code, i want to use the macro PT_R16 defined in
> > asm\ptrace.h.
> >
> > =========temp.c==========
> > asm("#include <asm\\ptrace.h>\n\t");
> > void dummy (void)
> > {
> > asm("stwu %r1, -PT_R16(%r1)"); /* stack */
> > }
> > =========end of temp.c===
> >
> > when i
> > gcc -c temp.c
> > error message:
> > /tmp/cc8ztvPf.s: Assembler messages:
> > /tmp/cc8ztvPf.s:13: Error: Negative of non-absolute symbol PT_R16
> >
> > if use
> > gcc -S temp.c
> > the file temp.s is:
> >
> > =========temp.s==========
> > .file "temp.c"
> > gcc2_compiled.:
> > #include <asm\ptrace.h>
> >
> > .section ".text"
> > .align 2
> > .globl dummy
> > .type dummy,@function
> > dummy:
> > stwu 1,-16(1)
> > stw 31,12(1)
> > mr 31,1
> > stwu %r1, -PT_R16(%r1)
> > .L2:
> > lwz 11,0(1)
> > lwz 31,-4(11)
> > mr 1,11
> > blr
> > .Lfe1:
> > .size dummy,.Lfe1-dummy
> > .ident "GCC: (GNU) 2.95.2 20000220 (Debian GNU/Linux)"
> > ======end of temp.s=============
> >
> >
> >
> >
>
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: how to use macro in assemble language embedded in C?
2000-12-27 3:33 ` kerler
@ 2000-12-27 15:50 ` Alexandre Oliva
0 siblings, 0 replies; 13+ messages in thread
From: Alexandre Oliva @ 2000-12-27 15:50 UTC (permalink / raw)
To: kerler; +Cc: Kaoru Fukui, gcc, linuxppc-dev
On Dec 27, 2000, "kerler" <kerler@newmail.net> wrote:
> so if i want use only one command line to compile temp.c,
> such as "gcc -c -other-option temp.c", which other-option should I add to
> make
> gcc creat a temporal assemble file /tmp/xxxx.S (not /tmp/xxxx.s) ?
I don't think there's any option to GCC that would make it run the
assembly code it outputs through a preprocessor.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: kerne-2.4.0-test13pre3 with gcc-2.97
2000-12-24 18:08 ` Alexandre Oliva
2000-12-26 1:41 ` how to use macro in assemble language embedded in C? kerler
@ 2000-12-27 23:37 ` Richard Henderson
1 sibling, 0 replies; 13+ messages in thread
From: Richard Henderson @ 2000-12-27 23:37 UTC (permalink / raw)
To: Alexandre Oliva; +Cc: sailer, Kaoru Fukui, linuxppc-dev, gcc
On Sun, Dec 24, 2000 at 04:08:08PM -0200, Alexandre Oliva wrote:
> > Which is not backward compatible, unfortunately.
>
> Indeed. I wish we had maintained the old syntax for
> backward-compatibility, even if with a deprecation warning.
We *have* maintained the old syntax.
But there are some quirky differences from the old behaviour wrt
initialization and sizeof that need to be resolved. To wit:
* The linux net/ code insists on initializing a zero-length array
member with an empty initializer. We should silently drop the
initialization in this case.
* Several places in the linux kernel expect sizeof of a zero-length
array to be zero. Typically this happens in some edge case like
long stuff[N_WORDS-1]
where a flexible array member isn't really wanted, but N_WORDS
happens to be 1 for some configuration.
Fixing this compatibility stuff is on my to-do list.
r~
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2000-12-27 23:37 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-23 5:52 kerne-2.4.0-test13pre3 with gcc-2.97 Kaoru Fukui
[not found] ` <20001223142145.T5858@coruscant.gnumonks.org>
2000-12-23 13:30 ` Kaoru Fukui
2000-12-24 3:29 ` Alexandre Oliva
2000-12-24 13:53 ` Kaoru Fukui
2000-12-24 15:20 ` Thomas Sailer
2000-12-24 15:19 ` Thomas Sailer
2000-12-24 18:08 ` Alexandre Oliva
2000-12-26 1:41 ` how to use macro in assemble language embedded in C? kerler
[not found] ` <20001226221757.Postino-028251@smtp01.highway.ne.jp>
2000-12-27 3:33 ` kerler
2000-12-27 15:50 ` Alexandre Oliva
2000-12-27 23:37 ` kerne-2.4.0-test13pre3 with gcc-2.97 Richard Henderson
2000-12-24 15:16 ` Thomas Sailer
-- strict thread matches above, loose matches on Subject: below --
2000-12-25 0:04 Kaoru Fukui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).