-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strip symbols from the Sequitur binary.
This saves about 30 MiBs...
- Loading branch information
Humdinger
committed
Oct 14, 2015
1 parent
64c20cf
commit 7fce22c
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7fce22c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use defineDebugInfoPackage() and extractDebugInfo() to create a debug package instead of doing things manually.
7fce22c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it seems that addons and libs should be stripped as well.
7fce22c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can use a defineDebugInfoPackage which results in a _debuginfo package and stripped files in the installation package. But where and how do I use extractDebugInfo to add ressources back into those files before they are packaged into the installation package? Those ressources contain icons and graphics.
Or did you mean to do the stripping with defineDebugInfoPackage and then adding the ressources again manually with xres?
7fce22c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think you still need xres to re-add the resources. We should fix our strip to not remove the resources...
7fce22c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit mystified now. Here's the recipe: http://sprunge.us/NIFK
And here is the tail of the output when haikuportering it: http://sprunge.us/JDcd
I end up with a debug_info package, which is good. I also get an installation package that has only stripped files without ressources! If I look into the sources in the working directory, I see all files unstripped.
Now, when exactly get the files stripped? When should I xres the ressources?
7fce22c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
defineDebugInfoPackage
shell function (defined in ShellScriptlets.py) records the paths of the files whose debug info shall be extracted. After theINSTALL
function of the recipe is finished,packageDebugInfos
is called which in turn callsextractDebugInfo
for each recorded file path.extractDebugInfo
is where the extraction of the debug info happens and where the original files arestrip
ped afterwards.The stripping is what also removes the resources. The back story here is the following: ELF is container file format. The file content is organized in (arbitrarily) named sections. A table at the beginning of the file lists the name, size, and in-file offset of all sections. That allows ELF tools to work with files that contain section types they don't know anything about. Unfortunately the Be Inc. devs decided not to add a new section type to store resources, but rather just append them at the end of the file. Due to that ELF tools are generally unaware of the additional data and remove them when modifying the file.
One could, as Adrien suggests, "fix" strip. But in fact one would have to "fix" every tool modifying ELF files. A cleaner solution would be to transition to a new resource format where the resources are contained in an ELF section. For the time being
extractDebugInfo
should be adjusted to first check whether the file has resources and, if so, save them before stripping and re-add them afterwards.7fce22c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info, Ingo.
So, currently that means I can't use defineDebugInfoPackage to strip files and create a _debuginfo package, because the stripping will occur after my INSTALL() where I could've re-added the resources.
Until extractDebugInfo is adjusted to preserve non-debug resources, would it be acceptable to use this recipe: http://sprunge.us/ZJCC and run it twice.
The recipe could be marked unsupported (ARCHITECTURES="!x86_gcc2") to show it has to be manually built in the described two-step process. Otherwise the soon-to-be-opened(?) Kitchen won't build the _debuginfo package.