This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/6887: g++-3.1 fails to link program on AIX 4.3.3



>Number:         6887
>Category:       c++
>Synopsis:       g++-3.1 fails to link program on AIX 4.3.3
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 31 08:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Philippe Nobili
>Release:        unknown-1.0
>Organization:
>Environment:
Reading specs from /DEVTOOLS/free/AIX4.3/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/DEVTOOLS/free/AIX4.3
Thread model: aix
gcc version 3.1
>Description:
g++-3.1 fails to correctly link-edit program on
AIX 4.3.3.

(So do g++-3.0.x x=0,1,2,3,4)
>How-To-Repeat:
g++ -c -frepo tryg++.cc
g++ tryg++.o

<==> Command Output : <==>

collect: recompiling tryg++.cc
collect: relinking
collect: recompiling tryg++.cc
collect: relinking
ld: 0711-317 ERROR: Undefined symbol: .std::ios_base::Init::Init[in-charge]()
ld: 0711-317 ERROR: Undefined symbol: .std::ios_base::Init::~Init [in-charge]()ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
>Fix:
None
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="tryg++.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="tryg++.cc"

LyogJElkJCAqLwoKI2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxtYXA+
CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxzdGFjaz4K
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fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX18KClROQ2FudmFzOjpUTkNhbnZhcyhjb25zdCBUTkNh
bnZhcyYgY2FudmFzKSB7CgogICp0aGlzID0gY2FudmFzIDsKfQovL19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fCgpUTkNhbnZhcyYgVE5DYW52YXM6Om9wZXJhdG9yID0oY29uc3QgVE5DYW52YXMmIGNhbnZh
cykgewoKICBpZiggdGhpcyAhPSAmY2FudmFzICkgewoKICAgIG54XyA9IGNhbnZhcy5ueF8gOwog
ICAgbnlfICA9Y2FudmFzLm55XyA7CiAgICBkeF8gPSBjYW52YXMuZHhfIDsKICAgIGR5XyA9IGNh
bnZhcy5keV8gOwogICAgbm9uVmFsdWVzXyA9IGNhbnZhcy5ub25WYWx1ZXNfIDsKICB9CiAgcmV0
dXJuICp0aGlzIDsKfQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCgpUTkNhbnZhczo6flROQ2FudmFz
KCkgewoKfQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX18KClROZXQ6OlROZXQoKSB7CgogIGNhbnZhc18g
PSAwIDsKfQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCgpUTmV0Ojp+VE5ldCgpIHsKCiAgY2xlYW5V
cCgpIDsKfQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCgovLyBQdXJwb3NlIDogZGVsZWxlcyB0aGUg
ZW50aXJlIHN0b3JhZ2UgKGFwaWNlcyxlZGdlcyA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ogPSAwICA7
IGogPCAobnkrMSkgOyBqKyspIHsKICAgIGZvciAoaW50IGkgPSAwIDsgaSA8IChueCsxKSA7IGkr
KykgewogICAgICBUTkFwZXggKmFwZXggPSBuZXcgVE5BcGV4KGkraioobngrMSkrMSkgOwogICAg
ICBhcGljZXNbaStqKihueCsxKV0gPSBhcGV4IDsKICAgIH0KICB9Cn0KLy9fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fXwoKLy8KLy8gUHVycG9zZTogY29ubmVjdHMgYXBpY2VzIHRvIGJ1aWxkIGVkZ2VzLgoK
dm9pZCBUTmV0OjpidWlsZEVkZ2VzRnJvbUFwaWNlcyhzdGQ6OnZlY3RvcjxUTkVkZ2UqPiYgZWRn
ZXMsY29uc3Qgc3RkOjp2ZWN0b3I8VE5BcGV4Kj4mIGEpIHsKCiAgaW50IG54ID0gZ2V0Q2FudmFz
KCktPmdldE54KCkgOwogIGludCBueSA9IGdldENhbnZhcygpLT5nZXROeSgpIDsKCiAgaW50IG5i
VE5FZGdlcyA9ICAzKm54Km55K254K255OwogIGVkZ2VzLnJlc2l6ZShuYlRORWRnZXMpIDsKICBp
bnQgc3ViMSAgICA9ICBueCoobnkrMSkgOwogIAogIGZvcihpbnQgaSA9IDAgOyBpIDwgc3ViMSA7
IGkrKykgeyAvLyBbMCxueF8qKG55XysxKVsKICAgCiAgICBUTkVkZ2UgKmUgID0gbmV3IFRORWRn
ZShpKzEpIDsKICAgIGUtPmNvbm5lY3RBcGljZXMoYVtpICsgaW50KGkvbngpICAgIF0sCgkJICAg
ICBhW2kgKyBpbnQoaS9ueCkgKyAxXSkgOwogICAgZWRnZXNbaV0gPSBlIDsKICB9CiAgaW50IG54
eSAgPSBueCpueSA7IAogIGludCBzdWIyID0gMipueHkrbngrbnkgOwoKICBmb3IoaW50IGkgPSBz
dWIxIDsgaSA8IHN1YjIgOyBpKyspIHsgLy8gW254KihueS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gICB0cmdsLT5jb25uZWN0RWRnZXMo
ZVtjaS8yIC0gMSArIG54ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwK
CQkgICAgICAgZVtjaS8yICAgICArIG54KihueSsxKSAgICAgICAgICAgICsgaW50KChjaS0xKS8o
MipueCkpXSwKCQkgICAgICAgZVtjaS8yIC0gMSArIG54KihueSsxKSArIG55KihueCsxKSAgICAg
ICAgICAgICAgICAgICAgXSkgOwogIH0KICBidWlsZEVkZ2VzV2luZ3MoZSkgOwogIGJ1aWxkTmV0
d29yaygpIDsKfQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KCi8vCi8vIFB1cnBvc2U6IGVzdGFibGlz
aGVzIHRoZSBjb25uZWN0aW9uIGJldHdlZW4gY2VsbHMuCgp2b2lkIFROZXQ6OmJ1aWxkTmV0d29y
aygpIHsKCiAgaW50IG54ID0gZ2V0Q2FudmFzKCktPmdldE54KCkgOwogIGludCBueSA9IGdldENh
bnZhcygpLT5nZXROeSgpIDsKICAKICBmb3IoaXRlcmF0b3IgaSA9IGJlZ2luKCkgOyBpICE9IGVu
ZCgpIDsgaSsrKSB7CgogICAgVE5DZWxsICp0cmdsID0gKmkgOwogICBpbnQgVCA9IHRyZ2wtPmdl
dENlbGxJZCgpIDsKCiAgIGJvb2wgaW5Eb21haW5bM10gOwogICBmb3IoaW50IGogPSAwIDsgaiA8
IDMgOyBqKyspIHsKICAgICBpZiggKFQlMiAgICAgID09IDEgJiYgVCA8PSAyKm54ICAgICAgICYm
IGogPT0gMCApIHx8CgkgKFQlKDIqbngpID09IDEgICAgICAgICAgICAgICAgICAgICYmIGogPT0g
MSApIHx8CgkgKFQlKDIqbngpID09IDAgICAgICAgICAgICAgICAgICAgICYmIGogPT0gMSApIHx8
CgkgKFQlMiAgICAgID09IDAgJiYgVCA+IDIqbngqKG55LTEpICYmIGogPT0gMCkpIHsKICAgICAg
IGluRG9tYWluW2pdID0gZmFsc2UgOwogICAgIH0KICAgICBlbHNlIGluRG9tYWluW2pdID0gdHJ1
ZSA7CiAgIH0KICAgaWYoIFQlMiA9PSAwICkgeyAvLyBFdmVuIG51bWJlcmVkIHRyaWFuZ2xlCiAg
ICAgdHJnbC0+c2V0TmVpZ2hib3VyKDAsKGluRG9tYWluWzBdID8gZ2V0Q2VsbEF0KFQgKyAyKm54
IC0gMikgOiAwKSkgOwogICAgIHRyZ2wtPnNldE5laWdoYm91cigxLChpbkRvbWFpblsxXSA/IGdl
dENlbGxBdChUICAgICAgICAgICApIDogMCkpIDsKICAgICB0cmdsLT5zZXROZWlnaGJvdXIoMiwo
aW5Eb21haW5bMl0gPyBnZXRDZWxsQXQoVCAgICAgICAgLSAyKSA6IDApKSA7CiAgIH0KICAgZWxz
ZSB7IC8vIE9kZCBudW1iZXJlZCB0cmlhbmdsZQogICAgIHRyZ2wtPnNldE5laWdoYm91cigwLChp
bkRvbWFpblswXSA/IGdldENlbGxBdChUIC0gMipueCkgOiAwKSkgOwogICAgIHRyZ2wtPnNldE5l
aWdoYm91cigxLChpbkRvbWFpblsxXSA/IGdldENlbGxBdChUIC0gMiAgICkgOiAwKSkgOwogICAg
IHRyZ2wtPnNldE5laWdoYm91cigyLChpbkRvbWFpblsyXSA/IGdldENlbGxBdChUICAgICAgICkg
OiAwKSkgOwogICB9CiAgfQp9Ci8vX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KCi8vCi8vIFB1cnBvc2U6
IGNvbm5lY3QgZWRnZXMgdG8gdGhlaXIgbmVpZ2hib3VyIHRyaWFuZ2xlcy4KCnZvaWQgVE5ldDo6
YnVpbGRFZGdlc1dpbmdzKGNvbnN0IHN0ZDo6dmVjdG9yPFRORWRnZSo+JiBlZGdlcykgewoKICBp
bnQgbnggPSBnZXRDYW52YXMoKS0+Z2V0TngoKSA7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nlfIDsKfQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCgovLwovLyBQdXJwb3NlOiBpbnRl
Z3JhdGVzIGJyYW5jaCBgYnInIGluIGB0aGlzJy4gVGhlIHR3byBib3VuZGFyaWVzIGFyZSBhbHNv
Ci8vICAgICAgICAgIG1lcmdlZC4KCnZvaWQgQnJhbmNoOjppbnRlZ3JhdGUoY29uc3QgQnJhbmNo
ICpicikgewoKICBzZXQ8Y29uc3QgVE5DZWxsKj4gbmV3VHJnbHMgOwogIHNldF91bmlvbihiZWdp
bigpLGVuZCgpLGJyLT5iZWdpbigpLGJyLT5lbmQoKSwKCSAgICBpbnNlcnRfaXRlcmF0b3I8c2V0
PGNvbnN0IFROQ2VsbCo+ID4obmV3VHJnbHMsbmV3VHJnbHMuYmVnaW4oKSkpIDsKICB0cmdsc18g
PSBuZXdUcmdscyA7CiAgYm91bmRhcnlfLT5pbnRlZ3JhdGUoYnItPmdldEJvdW5kYXJ5KCkpIDsK
fQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fCgpCcmFuY2hCb3VuZGFyeTo6QnJhbmNoQm91bmRhcnko
KSB7Cgp9Ci8vX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX18KCkJyYW5jaEJvdW5kYXJ5OjpCcmFuY2hCb3Vu
ZGFyeShjb25zdCBCcmFuY2hCb3VuZGFyeSYgYm91bmRhcnkpIHsKCiAgZWRnZXNfID0gYm91bmRh
cnkuZWRnZXNfIDsKfQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KCkJyYW5jaEJvdW5kYXJ5Ojp+QnJh
bmNoQm91b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X19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fCgovLyBQdXJwb3NlOiByZXR1cm4gd2hldGhlciBdQSxCXSBpbnRlcnNlY3RzIFtDRF0uIFRo
ZSBjYWxjdWxhdGlvbiBpcyBwZXJmb3JtZWQKLy8gICAgICAgICAgYWZ0ZXIgcHJvamVjdGlvbiBv
biBhbiBob3Jpem9udGFsIHBsYW5lLgoKaW5saW5lIGJvb2wgaW50ZXJzZWN0KGNvbnN0IFBvaW50
JiBBLGNvbnN0IFBvaW50JiBCLAoJCSAgICAgIGNvbnN0IFBvaW50JiBDLGNvbnN0IFBvaW50JiBE
KSB7CiAgCiAgVmVjdG9yIENBKEMsQSksQ0IoQyxCKSxEQShELEEpLERCKEQsQikgOwogIENBLnoo
KSA9IDAuMCA7IENCLnooKSA9IDAuMCA7IERBLnooKSA9IDAuMCA7IERCLnooKSA9IDAuMCA7CiAg
cmV0dXJuIChDQV5DQikqKERBXkRCKSA8PSAwICYmIChDQV5EQSkqKENCXkRCKSA8IDAgOwp9Ci8v
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX18KCkJyYW5jaFNldEJ1aWxkZXI6OkJyYW5jaFNldEJ1aWxkZXIo
Y29uc3QgVE5ldCogdG5ldCkgewoKICB0bmV0XyA9IHRuZXQgOwogIG11bHRpVmFsdWVkXyA9IHRy
dWUgOwp9Ci8vX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX18KCkJyYW5jaFNldEJ1aWxkZXI6On5CcmFuY2hT
ZXRCdWlsZGVyKCkgewoKICBjbGVhblVwKCkgOwp9Ci8vX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KCi8v
Ci8vIFB1cnBvc2U6IGlzIGl0IHBvc3NpYm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2hlc18odHJ1
ZSkgewoKfQovL19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCgpCcmFuY2hTZXQ6On5CcmFuY2hTZXQoKSB7
CgogIGNsZWFuVXAoKSA7Cn0KLy9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwoKQnJhbmNoU2V0OjpCcmFu
Y2hTZXQoY29uc3QgQnJhbmNoU2V0JiBicnNldCkgewoKICAqdGhpcyA9IGJyc2V0IDsKfQovL19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX18KCkJyYW5jaFNldCYgQnJhbmNoU2V0OjpvcGVyYXRvciA9KGNvbnN0
IEJyYW5jaFNldCYgYnJzZXQpIHsKCiAgaWYoIHRoaXMgIT0gJmJyc2V0ICkgewogICAgY2xlYW5V
cCgpIDsKICAgIGZvcihjb25zdF9pdGVyYXRvciBpID0gYnJzZXQuYmVnaW4oKSA7IGkgIT0gYnJz
ZXQuZW5kKCkgOyBpKyspIHsKICAgICAgYWRkQnJhbmNoKCppKSA7CiAgICB9CiAgfQogIHJldHVy
biAqdGhpcyA7Cn0KLy9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCgp2b2lkIEJyYW5jaFNldDo6Y2xlYW5V
cCgpIHsKCiAgaWYoIG1hbmFnZUJyYW5jaGVzKCkgKSB7CiAgICBmb3IoaXRlcmF0b3IgaSA9IGJl
Z2luKCkgOyBpICE9IGVuZCgpIDsgaSsrKSB7CiAgICAgIEJyYW5jaCAqYiA9IGNvbnN0X2Nhc3Q8
QnJhbmNoKj4oKmkpIDsKICAgICAgZGVsZXRlIGIgOwogICAgfQogIH0KICBicmFuY2hlc18uY2xl
YXIoKSA7Cn0KLy9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwoKQnJhbmNoSW50ZWdyYXRlcjo6QnJhbmNo
SW50ZWdyYXRlcigpIHsKCiAgaW5PbmVQYXNzXyA9IGZhbHNlOwp9Ci8vX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX18KCkJyYW5jaEludGVncmF0ZXI6On5CcmFuY2hJbnRlZ3JhdGVyKCkgewoKfQovL19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX18KCnZvaWQgQnJhbmNoSW50ZWdyYXRlcjo6YnJhbmNoZXNUb0JlSW50ZWdy
YXRlZChjb25zdCBCcmFuY2hTZXQmLGxpc3Q8QnJhbmNoKj4mIGJycykgewoKICBicnMuY2xlYXIo
KSA7Cn0KLy9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fXwoKQnJhbmNoKiBCcmFuY2hJbnRlZ3JhdGVyOjpi
cmFuY2hGb3JJbnRlZ3JhdGluZyhjb25zdCBCcmFuY2hTZXQmLGNvbnN0IEJyYW5jaCopIHsKCiAg
cmV0dXJuIDAgOwp9Ci8vX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KCi8vCi8vIFB1cnBvc2U6IHN0YXJ0
aW5nIGZyb20gYW4gaW5pdGlhbCBzZXQgb2YgYnJhbmNoZXMgYHNyYycsIGNyZWF0ZXMgYSBuZXcK
Ly8gICAgICAgICAgc2V0IG9mIGJyYW5jaGVzIG9uIG91dHB1dC4gVHdvIHZpcnR1YWwgbWV0aG9k
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9IGJyICYmCgl0b0NoZWNr
LT5hZGphY2VudFRvKGJyKSAmJgoJKHRoZUFyZWEgPSB0b0NoZWNrLT5hcmVhKCkpID4gbWF4QXJl
YSApIHsKICAgICAgdGhlQnJhbmNoID0gY29uc3RfY2FzdDxCcmFuY2gqPih0b0NoZWNrKSA7CiAg
ICAgIG1heEFyZWEgPSB0aGVBcmVhIDsKICAgIH0KICB9CiAgcmV0dXJuIHRoZUJyYW5jaCA7Cn0K
Ly9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fCgppbnQgbWFpbihpbnQgYXJnYyxjaGFyICoqYXJndikgewoK
ICAgcmV0dXJuIDAgOwp9Cg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]