Bug 30606 - [4.3 Regression] natVMURLConnection.cc:21: error: 'magic_t' does not name a typet name a type
Summary: [4.3 Regression] natVMURLConnection.cc:21: error: 'magic_t' does not name a t...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Tom Tromey
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2007-01-26 23:22 UTC by John David Anglin
Modified: 2007-02-13 16:17 UTC (History)
2 users (show)

See Also:
Host: hppa2.0w-hp-hpux11.11
Target: hppa2.0w-hp-hpux11.11
Build: hppa2.0w-hp-hpux11.11
Known to work:
Known to fail:
Last reconfirmed: 2007-01-29 19:03:53


Attachments
proposed patch (1.49 KB, patch)
2007-01-29 19:07 UTC, Tom Tromey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2007-01-26 23:22:49 UTC
/test/gnu/gcc/objdir/./gcc/xgcc -shared-libgcc -B/test/gnu/gcc/objdir/./gcc -nos
tdinc++ -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src -L/test/gn
u/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src/.libs -B/opt/gnu/gcc/gcc-4.3
.0/hppa2.0w-hp-hpux11.11/bin/ -B/opt/gnu/gcc/gcc-4.3.0/hppa2.0w-hp-hpux11.11/lib
/ -isystem /opt/gnu/gcc/gcc-4.3.0/hppa2.0w-hp-hpux11.11/include -isystem /opt/gn
u/gcc/gcc-4.3.0/hppa2.0w-hp-hpux11.11/sys-include -DHAVE_CONFIG_H -I. -I../../..
/gcc/libjava -I./include -I./gcj -I../../../gcc/libjava -Iinclude -I../../../gcc
/libjava/include -I../../../gcc/libjava/classpath/include -Iclasspath/include -I
../../../gcc/libjava/classpath/native/fdlibm -I../../../gcc/libjava/../boehm-gc/
include -I../boehm-gc/include -I../../../gcc/libjava/libltdl -I../../../gcc/libj
ava/libltdl -I../../../gcc/libjava/.././libjava/../gcc -I../../../gcc/libjava/..
/zlib -I../../../gcc/libjava/../libffi/include -I../libffi/include -fno-rtti -fn
on-call-exceptions -pthread -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSE
T_BITS=64 -Wextra -Wall -D_GNU_SOURCE -DPREFIX=\"/opt/gnu/gcc/gcc-4.3.0\" -DTOOL
EXECLIBDIR=\"/opt/gnu/gcc/gcc-4.3.0/lib\" -DJAVA_HOME=\"/opt/gnu/gcc/gcc-4.3.0\"
 -DBOOT_CLASS_PATH=\"/opt/gnu/gcc/gcc-4.3.0/share/java/libgcj-4.3.0.jar\" -DJAVA
_EXT_DIRS=\"/opt/gnu/gcc/gcc-4.3.0/share/java/ext\" -DGCJ_ENDORSED_DIRS=\"/opt/g
nu/gcc/gcc-4.3.0/share/java/gcj-endorsed\" -DGCJ_VERSIONED_LIBDIR=\"/opt/gnu/gcc
/gcc-4.3.0/lib/gcj-4.3.0\" -DPATH_SEPARATOR=\":\" -DLIBGCJ_DEFAULT_DATABASE=\"/o
pt/gnu/gcc/gcc-4.3.0/lib/gcj-4.3.0/classmap.db\" -DLIBGCJ_DEFAULT_DATABASE_PATH_
TAIL=\"gcj-4.3.0/classmap.db\" -g -O2 -MT java/net/natVMURLConnection.lo -MD -MP
 -MF java/net/.deps/natVMURLConnection.Tpo -c ../../../gcc/libjava/java/net/natV
MURLConnection.cc  -fPIC -DPIC -o java/net/.libs/natVMURLConnection.o
../../../gcc/libjava/java/net/natVMURLConnection.cc:21: error: 'magic_t' does no
t name a type
../../../gcc/libjava/java/net/natVMURLConnection.cc:23: error: ISO C++ forbids d
eclaration of 'magic_t' with no type
../../../gcc/libjava/java/net/natVMURLConnection.cc:23: error: 'p_magic_open' wa
s not declared in this scope
../../../gcc/libjava/java/net/natVMURLConnection.cc:23: error: expected ',' or '
;' before '(' token
../../../gcc/libjava/java/net/natVMURLConnection.cc:24: error: expected `)' befo
re 'cookie'
../../../gcc/libjava/java/net/natVMURLConnection.cc:24: error: expected primary-
expression before 'const'
../../../gcc/libjava/java/net/natVMURLConnection.cc:24: error: initializer expre
ssion list treated as compound expression
../../../gcc/libjava/java/net/natVMURLConnection.cc:25: error: expected `)' befo
re 'cookie'
../../../gcc/libjava/java/net/natVMURLConnection.cc:25: error: invalid conversio
n from 'int' to 'void*'
../../../gcc/libjava/java/net/natVMURLConnection.cc:26: error: expected `)' befo
re 'cookie'
../../../gcc/libjava/java/net/natVMURLConnection.cc:26: error: expected primary-
expression before 'const'
../../../gcc/libjava/java/net/natVMURLConnection.cc:27: error: expected primary-
expression before 'length'
../../../gcc/libjava/java/net/natVMURLConnection.cc:27: error: initializer expre
ssion list treated as compound expression
../../../gcc/libjava/java/net/natVMURLConnection.cc: In static member function '
static void java::net::VMURLConnection::init()':
../../../gcc/libjava/java/net/natVMURLConnection.cc:39: error: 'p_magic_open' wa
s not declared in this scope
../../../gcc/libjava/java/net/natVMURLConnection.cc:52: error: 'cookie' was not
declared in this scope
../../../gcc/libjava/java/net/natVMURLConnection.cc:52: error: 'MAGIC_MIME' was
not declared in this scope
../../../gcc/libjava/java/net/natVMURLConnection.cc:53: error: expected `)' befo
re '__null'
../../../gcc/libjava/java/net/natVMURLConnection.cc:55: error: 'p_magic_load' ca
nnot be used as a function
../../../gcc/libjava/java/net/natVMURLConnection.cc:57: error: 'p_magic_close' c
annot be used as a function
../../../gcc/libjava/java/net/natVMURLConnection.cc:58: error: expected `;' befo
re '__null'
../../../gcc/libjava/java/net/natVMURLConnection.cc: In static member function '
static java::lang::String* java::net::VMURLConnection::guessContentTypeFromBuffe
r(JArray<__java_byte>*, jint)':
../../../gcc/libjava/java/net/natVMURLConnection.cc:70: error: 'cookie' was not
declared in this scope
../../../gcc/libjava/java/net/natVMURLConnection.cc:70: error: expected `)' befo
re '__null'
../../../gcc/libjava/java/net/natVMURLConnection.cc:73: error: 'cookie' was not
declared in this scope
../../../gcc/libjava/java/net/natVMURLConnection.cc:73: error: 'p_magic_buffer'
cannot be used as a function
make[3]: *** [java/net/natVMURLConnection.lo] Error 1

On HP-UX 11.11, magic.h doesn't define magic_t, etc.
Comment 1 Tom Tromey 2007-01-29 19:07:37 UTC
Created attachment 12977 [details]
proposed patch

Please try this patch.  Now we look for magic_t and, if not found,
we disable the code.
Comment 2 dave 2007-01-30 23:50:33 UTC
Subject: Re:  [4.3 Regression] natVMURLConnection.cc:21: error: 'magic_t' does not name a type

> Please try this patch.  Now we look for magic_t and, if not found,
> we disable the code.

The patch is probably ok.  However, I've hit another problem linking
libgcj.sl.9.0:

/usr/ccs/bin/ld: CODE_ONE_SYM fixup to non-code subspace in file gnu/javax/swing
/text/html/.libs/parser.o - shared library must be position independent. Use +z
or +Z to recompile.

The wierd part of this is the above object was clearly compiled with
-fPIC but the object contains numerous non-PIC relocations in .data.

Dave
Comment 3 dave 2007-01-31 00:42:46 UTC
Subject: Re:  [4.3 Regression] natVMURLConnection.cc:21: error: 'magic_t' does not name a type

> /usr/ccs/bin/ld: CODE_ONE_SYM fixup to non-code subspace in file gnu/javax/swing
> /text/html/.libs/parser.o - shared library must be position independent. Use +z
> or +Z to recompile.
> 
> The wierd part of this is the above object was clearly compiled with
> -fPIC but the object contains numerous non-PIC relocations in .data.

One thing that I can see that's wrong is that .IMPORT directives
are missing for various symbols.  For example, the file calls
_ZN4java4lang6ObjectC1Ev but there's no no .IMPORT directive to
properly type the symbol.

Dave
Comment 4 Tom Tromey 2007-01-31 17:01:33 UTC
This is just a random guess, but do you have this patch (gcc/java):

2007-01-29  Andrew Haley  <aph@redhat.com>

	* class.c (add_method_1): Mark fndecl as external unless we are
	compiling it into this object file.

This may affect the latest problem here.
Comment 5 Tom Tromey 2007-01-31 17:11:27 UTC
Subject: Bug 30606

Author: tromey
Date: Wed Jan 31 17:11:11 2007
New Revision: 121425

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121425
Log:
	PR libgcj/30606:
	* configure, include/config.h.in: Rebuilt.
	* configure.ac: Check for magic_t in magic.h.
	* java/net/natVMURLConnection.cc: Use HAVE_MAGIC_T.

Modified:
    trunk/libjava/ChangeLog
    trunk/libjava/configure
    trunk/libjava/configure.ac
    trunk/libjava/include/config.h.in
    trunk/libjava/java/net/natVMURLConnection.cc

Comment 6 dave 2007-02-01 15:51:48 UTC
Subject: Re:  [4.3 Regression] natVMURLConnection.cc:21: error: 'magic_t' does not name a type

> This is just a random guess, but do you have this patch (gcc/java):
> 
> 2007-01-29  Andrew Haley  <aph@redhat.com>
> 
>         * class.c (add_method_1): Mark fndecl as external unless we are
>         compiling it into this object file.
> 
> This may affect the latest problem here.

With the above patch, the problem still exists but it's moved to a
different file:

/usr/ccs/bin/ld: CODE_ONE_SYM fixup to non-code subspace in file gnu/javax/swing
/text/html/parser/.libs/HTML_401F.o - shared library must be position independen
t. Use +z or +Z to recompile.

Dave
Comment 7 David Daney 2007-02-02 23:23:07 UTC
(In reply to comment #6)
> Subject: Re:  [4.3 Regression] natVMURLConnection.cc:21: error: 'magic_t' does
> not name a type
> 
> > This is just a random guess, but do you have this patch (gcc/java):
> > 
> > 2007-01-29  Andrew Haley  <aph@redhat.com>
> > 
> >         * class.c (add_method_1): Mark fndecl as external unless we are
> >         compiling it into this object file.
> > 
> > This may affect the latest problem here.
> 
> With the above patch, the problem still exists but it's moved to a
> different file:
> 
> /usr/ccs/bin/ld: CODE_ONE_SYM fixup to non-code subspace in file
> gnu/javax/swing
> /text/html/parser/.libs/HTML_401F.o - shared library must be position
> independen
> t. Use +z or +Z to recompile.
>

Please try with revision 121506 or later.  That may fix this problem.


Comment 8 dave 2007-02-04 16:00:48 UTC
Subject: Re:  [4.3 Regression] natVMURLConnection.cc:21: error: 'magic_t' does not name a type

> > With the above patch, the problem still exists but it's moved to a
> > different file:
> > 
> > /usr/ccs/bin/ld: CODE_ONE_SYM fixup to non-code subspace in file
> > gnu/javax/swing
> > /text/html/parser/.libs/HTML_401F.o - shared library must be position
> > independen
> > t. Use +z or +Z to recompile.
> >
> 
> Please try with revision 121506 or later.  That may fix this problem.

Sadly, it didn't fix the problem.

Dave
Comment 9 dave 2007-02-11 14:49:47 UTC
Subject: Re:  [4.3 Regression] natVMURLConnection.cc:21: error: 'magic_t' does not name a type

> > > With the above patch, the problem still exists but it's moved to a
> > > different file:
> > > 
> > > /usr/ccs/bin/ld: CODE_ONE_SYM fixup to non-code subspace in file
> > > gnu/javax/swing
> > > /text/html/parser/.libs/HTML_401F.o - shared library must be position
> > > independen
> > > t. Use +z or +Z to recompile.
> > >
> > 
> > Please try with revision 121506 or later.  That may fix this problem.

The above problem is a target bug (incorrect code is being generated
for long indirect and millicode calls).  The library now contains some
modules that need long calls.  Working on a patch to fix this.

David Daney's patch fixed the original problem.

Dave
Comment 10 John David Anglin 2007-02-13 16:17:59 UTC
The R_CODE_ONE_SYMBOL error was caused by my inadvertantly using
an experimental (buggy) version of gas.  Closing PR as fixed.