Xcode 3.2.x: Dynamic_cast doesn't work for template classes defined in dylib

slackfr

Aktives Mitglied
Thread Starter
Dabei seit
20.02.2006
Beiträge
425
Reaktionspunkte
1
Hatt schon jemand dieses Problem feststellen können?

Auf english, da der selbe Bugreport bereits bei Apple liegt, jedoch schon seit Monaten ohne reaktion.

PREPARE SECTION
(0.1)
Unpack the 'test.zip'

(0.2)
Go in the terminal to this test directory


BUILD SECTION

HowTo build the dynamic lib 'lib'

- (test with Xcode 3.2 and MacOSX10.6.sdk, gcc version 4.2.1 (Apple Inc. build 5646), -mmacosx-version-min=10.6)
(1.1) (copy & paste the next line to the terminal; hit return)
/Xcode3.2/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1 -isysroot /Xcode3.2/SDKs/MacOSX10.6.sdk -mfix-and-continue -fvisibility-inlines-hidden -mmacosx-version-min=10.6 -gdwarf-2 -c ./lib/lib.cpp -o ./lib/build/lib.o

(1.2) (copy & paste the next line to the terminal)
/Xcode3.2/usr/bin/g++-4.2 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.6.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.6 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib


HowTo build the application 'test'

(2.1) (copy & paste the next line to the terminal; hit return)
/Xcode3.2/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1 -isysroot /Xcode3.2/SDKs/MacOSX10.6.sdk -mfix-and-continue -fvisibility-inlines-hidden -mmacosx-version-min=10.6 -gdwarf-2 -c ./main.cpp -o ./build/main.o

(2.2) (copy & paste the next line to the terminal; hit return)
/Xcode3.2/usr/bin/g++-4.2 -arch x86_64 -isysroot /Xcode3.2/SDKs/MacOSX10.6.sdk -L./lib/build ./build/main.o -mmacosx-version-min=10.6 -llib -o ./test


TEST SECTION

Run the application

(3) (copy & paste the next line to the terminal; hit return)
./test


Results of the Test

(4.1)
________________________
Dynamic-cast-test START.
-----> DONT work!
Dynamic-cast-test END.
----------------------



TEST CASES

>>>>>> Now change only the link part (1.2) <<<<<<

- (test with Xcode 3.1.4 and MacOSX10.6.sdk, gcc version 4.2.1 (Apple Inc. build 5577), -mmacosx-version-min=10.6)
(1.3)
/Xcode3.1.4/usr/bin/g++-4.2 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.6.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.6 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib

(3)
./test

(4.2)
________________________
Dynamic-cast-test START.
-----> All Ok!
Dynamic-cast-test END.
----------------------



- (test with Xcode 3.1.4 and MacOSX10.5.sdk, gcc version 4.2.1 (Apple Inc. build 5577), -mmacosx-version-min=10.6)
(1.4)
/Xcode3.1.4/usr/bin/g++-4.2 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.5.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.6 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib

(3)
./test

(4.3)
________________________
Dynamic-cast-test START.
-----> All Ok!
Dynamic-cast-test END.
----------------------


- (test with Xcode 3.2 and MacOSX10.5.sdk, gcc version 4.2.1 (Apple Inc. build 5646), -mmacosx-version-min=10.5)
(1.5)
/Xcode3.2/usr/bin/g++-4.2 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.5.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.5 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib

(3)
./test

(4.4)
________________________
Dynamic-cast-test START.
-----> DONT work!
Dynamic-cast-test END.
----------------------


- (test with Xcode 3.2 and MacOSX10.5.sdk, gcc version 4.0.1 (Apple Inc. build 5493), -mmacosx-version-min=10.5)
(1.6)
/Xcode3.2/usr/bin/g++-4.0 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.5.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.5 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib

(3)
./test

(4.5)
________________________
Dynamic-cast-test START.
-----> DONT work!
Dynamic-cast-test END.
----------------------


- (test with Xcode 3.2 and MacOSX10.4u.sdk, gcc version 4.0.1 (Apple Inc. build 5493), -mmacosx-version-min=10.4)
(1.7)
/Xcode3.2/usr/bin/g++-4.0 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.4u.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.4 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib

(3)
./test

(4.6)
________________________
Dynamic-cast-test START.
-----> All Ok!
Dynamic-cast-test END.
----------------------



- (test with Xcode 3.1.4 and MacOSX10.4u.sdk, gcc version 4.0.1 (Apple Inc. build 5493), -mmacosx-version-min=10.4)
(1.8)
/Xcode3.1.4/usr/bin/g++-4.0 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.4u.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.4 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib

(3)
./test

(4.7)
________________________
Dynamic-cast-test START.
-----> All Ok!
Dynamic-cast-test END.
----------------------


- (test with Xcode 3.1.4 and MacOSX10.4u.sdk, gcc version 4.2.1 (Apple Inc. build 5577), -mmacosx-version-min=10.4)
(1.9)
/Xcode3.1.4/usr/bin/g++-4.2 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.4u.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.4 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib

(3)
./test

(4.8)
________________________
Dynamic-cast-test START.
-----> All Ok!
Dynamic-cast-test END.
----------------------


- (test with Xcode 3.1.4 and MacOSX10.5.sdk, gcc version 4.0.1 (Apple Inc. build 5493), -mmacosx-version-min=10.5)
(1.10)
/Xcode3.1.4/usr/bin/g++-4.0 -arch x86_64 -dynamiclib -isysroot /Xcode3.2/SDKs/MacOSX10.5.sdk ./lib/build/lib.o -install_name ./lib/build/liblib.dylib -mmacosx-version-min=10.5 -single_module -compatibility_version 1 -current_version 1 -o ./lib/build/liblib.dylib

(3)
./test

(4.9)
________________________
Dynamic-cast-test START.
-----> All Ok!
Dynamic-cast-test END.
----------------------


INFORMATION TO USED COMPILERS

Xcode 3.2
/Xcode3.2/usr/bin/gcc-4.2 -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646)

/Xcode3.2/usr/bin/gcc-4.0 -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc_40/gcc_40-5493~95/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-arch=apple --with-tune=generic --host=i686-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5493)

Xcode 3.1.4
/Xcode3.1.4/usr/bin/gcc-4.2 -v
Using built-in specs.Target: i686-apple-darwin9Configured with: /var/tmp/gcc_42/gcc_42-5577~1/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-gxx-include-dir=/usr/include/c++/4.0.0 --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5577)

/Xcode3.1.4/usr/bin/gcc-4.0 -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5493~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5493)


SUMMARY

Using the gcc-4.0 one time from the Xcode3.2 bundle and the another time from Xcode3.1.4 bundle but with the same configurations (compare with point (1.10) and (1.6)) we have different results:
- All Ok with the gcc-4.0 from Xcode3.1.4
- DONT work with the gcc-4.0 from Xcode3.2

In all test were used the SDKs from the Xcode3.2 bundle!

This gcc-4.0 have the same revision-number 5493. In the configuration they have one different in the --build, --host and --target flag:
- gcc-4.0 from Xcode3.1.4 use i686-apple-darwin9
- gcc-4.0 from Xcode3.2 use i686-apple-darwin10

Anbei ein kleines Testprojekt.
 

Anhänge

  • test.zip
    6,2 KB · Aufrufe: 56
Zurück
Oben Unten