Skip to content

Commit

Permalink
Preserve resources and attributes when copying stripped binaries
Browse files Browse the repository at this point in the history
When asked to strip binaries when copying to containers we now
strip to a temporary file, copy over resources to it, copy it
to the container, then copy the attributes from the original
source.

This should allow stripping binaries while preserving attributes
and resources even when copying to images.
  • Loading branch information
mmuman committed Oct 12, 2013
1 parent e233298 commit a427aa2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build/jam/ImageRules
Expand Up @@ -800,11 +800,17 @@ actions AppendToContainerCopyFilesScriptStripFile
>> $(2[1])
fi

echo \$cp "\"\${sPrefix}$(2[2])\"" \
echo "stripped_file=\"\${tmpDir}/stripped_\$\$\"" >> $(2[1])

echo \$strip -o "\"\${stripped_file}\"" "\"\${sPrefix}$(2[2])\"" >> $(2[1])
echo \$xres -o "\"\${stripped_file}\"" "\"\${sPrefix}$(2[2])\"" >> $(2[1])

echo \$cp "\"\${stripped_file}\"" \
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])
echo \$copyattr "\"\${sPrefix}$(2[2])\"" \
"\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" >> $(2[1])

echo \$strip "\"\${tPrefix}$(TARGET_DIR)/$(INSTALL_TARGET_NAME)\"" \
"2>/dev/null" "|| true" >> $(2[1])
echo \$rm "\"\${stripped_file}\"" >> $(2[1])
}


Expand Down
1 change: 1 addition & 0 deletions build/jam/images/FloppyBootImage
Expand Up @@ -184,6 +184,7 @@ AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
AddTargetVariableToScript $(script) : <build>copyattr ;
AddTargetVariableToScript $(script) : $(HAIKU_STRIP_$(TARGET_ARCH)) : strip ;
AddTargetVariableToScript $(script) : <build>xres ;

# create the other scripts
local makeDirsScript = <FloppyBootArchive>haiku-floppyboot-make-dirs ;
Expand Down

0 comments on commit a427aa2

Please sign in to comment.