Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Nov 2001 23:45:16 +0100
From:      "Sven C. Koehler" <schween@snafu.de>
To:        obrien@FreeBSD.org
Cc:        freebsd-ports@freebsd.org
Subject:   gcc30(gcc30-3.0.2): C++ and ObjC broken?
Message-ID:  <20011117234516.A8949056@zedat.fu-berlin.de>

next in thread | raw e-mail | index | archive | help

--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi!

I'm not able to run C++ and ObjC executables, when using gcc30's GCC-3.0.2.
I attached simple hello worlds for both languages to this e-mail; the 
coredumps's back traces are also included.  

My system: FreeBSD 4.1.1-STABLE as of 2001-01-06.  

This is what it looks like when I run the appended programs (they both
work when I use GCC-2.95.2):

C++:
    (% g++30 -g -o cppHello cppHello.cpp)
    % ./cppHello
    zsh: 23925 bus error (core dumped)  ./cppHello

ObjC:
    (% gcc30 -Wno-import -g -o objcHello objcHello.m -lobjc)
    % ./objcHello
    assertion "__objc_class_hash" failed: file "../../../gcc-3.0.2/libobjc/class.c", line 131
    zsh: 23946 abort (core dumped)  ./objcHello

Drop me a note, if you want this as a PR.

Regards, 

Sven C. Koehler

--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cppHello.cpp"

#include <iostream>
int main() { std::cout << "Hello" << std::endl; return 0; }


--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="objcHello.m"

#include <stdio.h>
#import <objc/Object.h>
#import <objc/objc-api.h>

@interface Test
+ (void)sayHello;
@end

@implementation Test
+ (void)sayHello { printf("Hello\n"); }
@end

int main() { [Test sayHello]; return 0; }


--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cppHello.stacktrace"

Core was generated by `cppHello'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0  0x8053c49 in sentry (this=0xbfbff5c8, __os=@0x8066d20) at ostream.tcc:39
39          : _M_ok(__os.good()), _M_os(__os)
(gdb) bt
#0  0x8053c49 in sentry (this=0xbfbff5c8, __os=@0x8066d20) at ostream.tcc:39
#1  0x8053946 in _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc (
    __out=@0x8066d20, __s=0x8064de0 "Hello") at ostream.tcc:691
#2  0x8048c63 in main () at cppHello.cpp:4


--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="objcHello.stacktrace"

Core was generated by `objcHello'.
Program terminated with signal 6, Abort trap.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0  0x280aafc8 in kill () from /usr/lib/libc.so.4
(gdb) bt
#0  0x280aafc8 in kill () from /usr/lib/libc.so.4
#1  0x280e6bf2 in abort () from /usr/lib/libc.so.4
#2  0x280c39cb in __assert () from /usr/lib/libc.so.4
#3  0x8048bf5 in objc_get_class ()
#4  0x80489b8 in main () at objcHello.m:13


--d6Gm4EdcadzBjdND--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011117234516.A8949056>