Opened 16 years ago
Closed 16 years ago
#3472 closed bug (fixed)
gcc4 and shared libraries
Reported by: | kaliber | Owned by: | mmlr |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Build System | Version: | R1/pre-alpha1 |
Keywords: | Cc: | planche2k@…, umccullough@…, eric.petit@… | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
1) gcc4 doesn't support '-shared', patch included
2) g++4 does link against libstdc++ statically and a size of hello word program is over 1Mb (g++2 is 5kb only), in my opinion there should be libstdc++.so.5 available
Attachments (4)
Change History (13)
by , 16 years ago
Attachment: | gcc-haiku-shared.patch added |
---|
comment:1 by , 16 years ago
Owner: | changed from | to
---|
comment:2 by , 16 years ago
I investigated shared version of libstdc++ yesterday (see patches, with kaliber patch already applied) and there is a chicken egg problem, when building gcc with --enable-shared=libstdc++ (according to gcc docs it's builded as shared, rest is static like with --disable-shared)
It fails to build because of missing crti.o crtn.o start_dyn.o init_term_dyn.o which are haiku specific.
I moved them from src/system/glue to gcc dir and now it builds fine, but linker wants libroot which isn't available yet.
I think we have two choices if we want to have shared libstdc++:
- cross-build gcc with static libstdc++, build libroot and rebuild libstdc++
- move building haiku to haiku itself
Maybe i missed something, but that's so far i get into trying to make it work
comment:3 by , 16 years ago
I've adapted the specs in hrev29297. Note that just adding -shared to the linkspecs isn't enough, but also excluding start_dyn.o is required.
About the shared libstdc++. It will be provided as a binary when the package is updated. I don't think it's really worth the effort to build it as shared when building the cross-compiler. Therefore it's not really necessary to hack in the Haiku specific files into the gcc build system.
GCC as well as Haiku can be built just fine under Haiku, so it's not really a problem to just build the shared libstdc++ afterwards. The GCC4 package will provide it once it is updated.
comment:4 by , 16 years ago
Cc: | added |
---|
comment:5 by , 16 years ago
Is it possible that the Optional Package has not been updated with this change?
If so, are there instructions how to configure gcc 4.3 on Haiku to overwrite the one from the Optional Package to try this out?
comment:6 by , 16 years ago
Cc: | added |
---|
comment:7 by , 16 years ago
People, don't panic. The optional package hasn't been updated yet. The GCC build system, being quite complex, currently triggers a severe bug in Haiku that I'd like to find and fix. So my priority is to fix the problem and not to actually build a new GCC. It will be made available soon, probably during the next week. For now if you're really desperate you can still overwrite the specs by supplying a specs file and applying the changes from hrev29297 to that one:
gcc -dumpspecs > /boot/develop/gnupro/lib/gcc/i586-pc-haiku/4.3.3/specs open /boot/develop/gnupro/lib/gcc/i586-pc-haiku/4.3.3/specs
comment:8 by , 16 years ago
Cc: | added |
---|
comment:9 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Updated the optional package in hrev29501.
gcc -shared