Opened 15 years ago

Closed 15 years ago

#4842 closed enhancement (fixed)

[patch] P7zip optional package for GCC4

Reported by: jprostko Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/Development
Keywords: Cc: scottmc2@…
Blocked By: Blocking:
Platform: x86

Description

Hello,

I have built P7zip for GCC4 on hrev33573 of Haiku.

Below is a link to the zip file, including the .OptionalPackageDescription file:

http://haiku-ports.de/packages/app-arch/p7zip/p7zip-9.04-x86-gcc4-2009-10-24.zip

It will need to be moved to http://haiku-files.org/files/optional-packages/ in order for the attached patch to work. There is already a p7zip 9.04 optional package I did back in July that is on the haiku-files.org server, but I figured it'd make sense to do a build on a current (post-alpha) version of Haiku.

Attachments (2)

OptionalPackages.diff (1005 bytes ) - added by jprostko 15 years ago.
OptionalPackages diff to update p7zip for GCC2 and GCC4
p7zip.haiku.diff (1019 bytes ) - added by korli 15 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by korli, 15 years ago

Sorry, but what's the need for this gcc4 build ? There is the gcc2 build which is also fine for gcc4 haiku builds. http://haiku-files.org/files/optional-packages/p7zip-9.04-r1a1-x86-gcc2-2009-08-30.zip

in reply to:  1 ; comment:2 by jprostko, 15 years ago

Replying to korli:

Sorry, but what's the need for this gcc4 build ? There is the gcc2 build which is also fine for gcc4 haiku builds. http://haiku-files.org/files/optional-packages/p7zip-9.04-r1a1-x86-gcc2-2009-08-30.zip

Well, seeing as there is C++ code and the GCC2 version is therefore linked against libstdcc++.hrev4.so instead of libstdc++.so, it won't work on a strictly GCC4 build of Haiku. I suppose I didn't really notice either until I tried making a purely GCC4 build of Haiku lately, only to have P7zip not work.

in reply to:  2 comment:3 by jprostko, 15 years ago

Replying to jprostko:

Well, seeing as there is C++ code and the GCC2 version is therefore linked against libstdcc++.hrev4.so instead of libstdc++.so, it won't work on a strictly GCC4 build of Haiku. I suppose I didn't really notice either until I tried making a purely GCC4 build of Haiku lately, only to have P7zip not work.

Sorry to reply to myself, but I hit reply a little prematurely without thinking through my response completely. The patch also addressed the fact that you aren't given a P7zip at all if you do a pure GCC4 build. You would then have to download one from haiku-files.org...assuming you know about it. If you happened to download one of the GCC2 versions there, it wouldn't work at all, complaining about a missing libstdc++.hrev4.so. If you downloaded the optional package I made for GCC4 back in July from there though, it would work as desired. I just don't see the need to jump through hoops like that for somebody who isn't aware of those facts.

comment:4 by korli, 15 years ago

I checked p7zip sources and indeed libbe.so is used for the beos build. As it shouldn't be the case for haiku, I made a patch which only uses pthreads.

in reply to:  4 ; comment:5 by jprostko, 15 years ago

Replying to korli:

I checked p7zip sources and indeed libbe.so is used for the beos build. As it shouldn't be the case for haiku, I made a patch which only uses pthreads.

Yeah, I noticed that yesterday after I had built it (via readelf -d), but saw the GCC2 package was the same way, so let it be.

That said, I have just now rebuilt GCC2 and GCC4 packages using your patch. I will attach an updated OptionalPackages patch momentarily, but naturally it can't be applied until the two package files are moved to haiku-files.org from haiku-ports.de by somebody with that capability.

by jprostko, 15 years ago

Attachment: OptionalPackages.diff added

OptionalPackages diff to update p7zip for GCC2 and GCC4

in reply to:  5 ; comment:6 by korli, 15 years ago

Replying to jprostko:

That said, I have just now rebuilt GCC2 and GCC4 packages using your patch. I will attach an updated OptionalPackages patch momentarily, but naturally it can't be applied until the two package files are moved to haiku-files.org from haiku-ports.de by somebody with that capability.

Would it be possible to check if the GCC2 package works as is on a GCC4 Haiku. One package should fit both.

in reply to:  6 comment:7 by jprostko, 15 years ago

Replying to korli:

Would it be possible to check if the GCC2 package works as is on a GCC4 Haiku. One package should fit both.

Just checked it, and like I expected, got the following:

~> 7za runtime_loader: Cannot open file libstdc++.hrev4.so: No such file or directory

Basically, the GCC2 package will work on a pure or hybrid GCC2 build, as well as a GCC4 hybrid build, but not work on a pure GCC4 build. The GCC4 package will work on a pure or hybrid GCC4 build, as well as a GCC2 hybrid build, but not work on a pure GCC2 build. In other words, the pure GCC builds don't have the other GCC's C++ libraries available.

The GCC4 build of p7zip requires libroot.so and libstdc++.so , whereas the GCC2 build requires libroot.so and libstdc++.hrev4.so . If this were curl or something we were compiling that only had C code, then yeah, it'd work just fine for all GCC variant builds since there were no ABI changes. Since there is C++ code involved, however, it simply won't work that way.

If the plan is to do away with supporting of building GCC4-only builds in the future (and/or GCC2-only builds for that matter), then yeah, we could tidy up OptionalPackages quite a bit by building GCC2 versions of most packages, and building GCC4 packages only when needed. I kind of don't think that is in the pipeline or anything as far as I know though.

comment:8 by jprostko, 15 years ago

Both files are now on haiku-files.org, and as such, OptionalPackages can be updated.

comment:9 by korli, 15 years ago

Seems the patch I provided keeps using g++ as linker, which brings libstdc++ even if not needed. Please find an updated patch.

by korli, 15 years ago

Attachment: p7zip.haiku.diff added

in reply to:  9 comment:10 by jprostko, 15 years ago

Replying to korli:

Seems the patch I provided keeps using g++ as linker, which brings libstdc++ even if not needed. Please find an updated patch.

Well, I compiled with your patch using GCC2, and it was built without bringing in libstdc++. It worked fine on GCC2 (pure/hybrid), as well as a GCC4 hybrid. However, I came upon this problem when trying on a pure GCC4 build.

~> 7za runtime_loader: /boot/common/bin/7za: Could not resolve symbol 'tic' resolve symbol "tic" returned: -2147478780 runtime_loader: /boot/common/bin/7za: Troubles relocating: Symbol not found

Also worth noting was that the binary size bloated up several hundred kilobytes with the latest patch.

comment:11 by korli, 15 years ago

OK. I wasn't expecting this behavior with gcc. I applied the OptionalPackages patch in hrev33763.

Though the packages need to be fixed: it seems the permissions extracted on Linux don't let jam delete the uncompressed files: Could you check the DOCS directory ? Thanks Error: Failed to remove entry "/home/korli/svnhaiku/haiku/generated_v43/tmp/unzip/common/share/doc/p7zip/DOCS/7zC.txt": Permission denied Error: Failed to remove entry "/home/korli/svnhaiku/haiku/generated_v43/tmp/unzip/common/share/doc/p7zip/DOCS/MANUAL/syntax.htm": Permission denied

in reply to:  11 comment:12 by jprostko, 15 years ago

Replying to korli:

OK. I wasn't expecting this behavior with gcc. I applied the OptionalPackages patch in hrev33763.

Thanks.

Though the packages need to be fixed: it seems the permissions extracted on Linux don't let jam delete the uncompressed files: Could you check the DOCS directory ? Thanks

I won't get a chance to look at it until tomorrow morning (as I'm not home right now), but I'll get it sorted out as soon as I can.

comment:13 by jprostko, 15 years ago

Okay, I went through and set all directories and the executable to 755, and all other files to 644. The updated packages are now resident on haiku-files.org (using the same filenames), so anybody snagging the packages from now on should have no issues.

If there are any problems, let me know.

comment:14 by mmadia, 15 years ago

Resolution: fixed
Status: newclosed

Some time ago, the OptionalPackage was updated to fix the permissions.

Note: See TracTickets for help on using tickets.