Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 929193 - app-arch/libarchive-3.7.3: configure error when /bin/sh != bash
Summary: app-arch/libarchive-3.7.3: configure error when /bin/sh != bash
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Michał Górny
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: nonbash
  Show dependency tree
 
Reported: 2024-04-11 20:58 UTC by Matt Whitlock
Modified: 2024-04-11 21:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
3.7.3-configure-fix-bashism.patch (3.7.3-configure-fix-bashism.patch,1.18 KB, patch)
2024-04-11 20:58 UTC, Matt Whitlock
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2024-04-11 20:58:00 UTC
Created attachment 890470 [details, diff]
3.7.3-configure-fix-bashism.patch

Libarchive's configure.ac contains a Bashism (use of == operator with test built-in). Thus, configure emits an error when /bin/sh is not Bash. This doesn't cause the build to fail outright, but it may be causing misdetection of features.

checking whether C compiler accepts -Wall... (cached) yes
checking whether C compiler accepts -Wformat... (cached) yes
checking whether C compiler accepts -Wformat-security... (cached) yes
checking whether ld supports --gc-sections... yes
checking whether C compiler accepts -ffunction-sections... (cached) yes
checking whether C compiler accepts -fdata-sections... (cached) yes
/var/tmp/portage/app-arch/libarchive-3.7.3/work/libarchive-3.7.3/configure: 17818: test: -Wl,--gc-sections: unexpected operator

The error is due to this Bashism in configure.ac:

if test "$DEAD_CODE_REMOVAL" == ""; then

The attached patch corrects the Bashism and allows app-arch/libarchive-3.7.3 to configure without error.

Note: The patch has to touch the aclocal.m4 file to set its mtime after configure.ac's, or else the build fails due to auto-regenerating only some of the generated build system, leading to a libtool version mismatch.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-11 21:01:48 UTC
I should've done -z, but I fixed it upstream already with =.