Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unzip was not building with bzip2 support #18

Merged
merged 5 commits into from
Jan 29, 2024
Merged

Unzip was not building with bzip2 support #18

merged 5 commits into from
Jan 29, 2024

Conversation

citrus-it
Copy link
Collaborator

This imports several unzip fixes from upstream - omniosorg/omnios-build#3449

build:omnios:unzip% ./build/unzip/tmp/build/unzip -t /tmp/build-gimlet-b-lab-image-default.zip
Archive:  /tmp/build-gimlet-b-lab-image-default.zip
hubris build archive v8
    testing: README.TXT               OK
    testing: git-rev                  OK
    testing: image-name               OK
    testing: app.toml                 OK
    testing: chip.toml                OK
    testing: memory.toml              OK
    testing: elf/task/jefe            OK
    testing: elf/task/net             OK
    testing: elf/task/sys             OK
    testing: elf/task/spi2_driver     OK
    testing: elf/task/i2c_driver      OK
    testing: elf/task/spd             OK
    testing: elf/task/packrat         OK
    testing: elf/task/thermal         OK
    testing: elf/task/power           OK
    testing: elf/task/hiffy           OK
    testing: elf/task/gimlet_seq      OK
    testing: elf/task/hash_driver     OK
    testing: elf/task/hf              OK
    testing: elf/task/update_server   OK
    testing: elf/task/sensor          OK
    testing: elf/task/host_sp_comms   OK
    testing: elf/task/udpecho         OK
    testing: elf/task/udpbroadcast    OK
    testing: elf/task/control_plane_agent   OK
    testing: elf/task/sprot           OK
    testing: elf/task/validate        OK
    testing: elf/task/vpd             OK
    testing: elf/task/user_leds       OK
    testing: elf/task/dump_agent      OK
    testing: elf/task/sbrmi           OK
    testing: elf/task/idle            OK
    testing: elf/task/udprpc          OK
    testing: elf/kernel               OK
    testing: img/flash.ron            OK
    testing: debug/script.gdb         OK
    testing: debug/openocd.cfg        OK
    testing: debug/openocd.gdb        OK
    testing: task/gimlet_seq/gimlet-regs-b.json   OK
    testing: img/final.bin            OK
    testing: img/final.elf            OK
    testing: img/final.fwid           OK
No errors detected in compressed data of /tmp/build-gimlet-b-lab-image-default.zip.

This appears to have begun at the point that we stopped
shipping the static libbz2.a.

Fixes: omniosorg/omnios-build#3448
@citrus-it citrus-it requested a review from rmustacc January 25, 2024 13:54
@citrus-it citrus-it self-assigned this Jan 25, 2024
Copy link

@rmustacc rmustacc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together @citrus-it.

@@ -48,6 +50,7 @@ configure_aarch64() {
}

pre_install() {
ldd $PROG | $EGREP -s libbz2 || logerr "unzip was built without bzip2"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should be using eldfump -d here as otherwise you could get a false positive if a dep of a dep had libbz2 support.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, and the test also doesn't work for cross compiled binaries such as aarch64. Here's an update.

@@ -50,7 +50,8 @@ configure_aarch64() {
}

pre_install() {
ldd $PROG | $EGREP -s libbz2 || logerr "unzip was built without bzip2"
$ELFEDIT -e dyn:dump -o simple $PROG | $EGREP -s 'libbz2\.so' \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ELFEDIT -e dyn:dump -o simple $PROG | $EGREP -s 'libbz2\.so' \
$ELFEDIT -r -e 'dyn:tag NEEDED' -o simple $PROG | $EGREP -s 'libbz2\.so' \

This makes sure that elfedit opens it read-only, which should be fine, but if the users are off will throw this off. Tihs also only dumps the needed tag, so that way if something else is in here and matches for some weird reason, you'll not be thrown off. Here's an example output:

rm@beren:~$ elfedit -r -e 'dyn:tag NEEDED' /usr/bin/ls
     index  tag                value
       [1]  NEEDED            0x693               libsec.so.1
       [3]  NEEDED            0x6b8               libnvpair.so.1
       [5]  NEEDED            0x6d0               libcmdutils.so.1
       [7]  NEEDED            0x6e1               libcurses.so.1
       [8]  NEEDED            0x6f0               libc.so.1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's better, done.

@citrus-it citrus-it merged commit 68b2a6e into helios2 Jan 29, 2024
@citrus-it citrus-it deleted the andy/unzip branch January 29, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants