Bug 1085127 - optflags should not set -fsigned-char
optflags should not set -fsigned-char
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
ppc64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
Depends On:
Blocks: ARMTracker PPCTracker
  Show dependency treegraph
Reported: 2014-04-07 18:19 EDT by Aldy Hernandez
Modified: 2014-05-07 06:03 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-05-07 06:03:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Aldy Hernandez 2014-04-07 18:19:37 EDT
Description of problem:

-fsigned-char is being set in optflags (/usr/lib/rpm/rpmc) for PPC variants:

optflags: ppc -O2 -g -fsigned-char
optflags: ppc8260 -O2 -g -fsigned-char
optflags: ppc8560 -O2 -g -fsigned-char
optflags: ppc32dy4 -O2 -g -fsigned-char
optflags: ppciseries -O2 -g -fsigned-char
optflags: ppcpseries -O2 -g -fsigned-char
optflags: ppc64 -O2 -g -fsigned-char
optflags: ppc64p7 -O3 -mtune=power7 -mcpu=power7 -g -fsigned-char

Most of these are then being overridden by redhat-rpm-config (/usr/lib/rpm/redhat/rpmrc):

optflags: ppc %{__global_cflags} -m32
optflags: ppciseries %{__global_cflags} -m32
optflags: ppcpseries %{__global_cflags} -m32
optflags: ppc64 %{__global_cflags} -m64
optflags: ppc64iseries %{__global_cflags} -m64
optflags: ppc64pseries %{__global_cflags} -m64
optflags: ppc8260 %{__global_cflags} -m32
optflags: ppc8560 %{__global_cflags} -m32

As passing -fsigned-char and -funsigned-char is an ABI change, rpm should NOT be passing these ever.  The compiler should be in charge of setting the ABI.

At least for ppc64, the default ABI is unsigned char, so the override in redhat-rpm-config has everything working fine, but ideally rpm nor its subsidiaries should be passing -fsigned-char or -funsigned-char.

I also see Arm is doing something similar in /usr/lib/rpm/redhat/rpmrc (redhat-rpm-config package):

optflags: armv3l %{__global_cflags} -fsigned-char -march=armv3
optflags: armv4b %{__global_cflags} -fsigned-char -march=armv4
optflags: armv4l %{__global_cflags} -fsigned-char -march=armv4
optflags: armv4tl %{__global_cflags} -march=armv4t
optflags: armv5tel %{__global_cflags} -march=armv5te -mfloat-abi=soft
optflags: armv5tejl %{__global_cflags} -march=armv5te -mfloat-abi=soft
optflags: armv6l %{__global_cflags} -march=armv6 -mfloat-abi=soft
optflags: armv7l %{__global_cflags} -march=armv7-a -mfloat-abi=soft
optflags: armv7hl %{__global_cflags} -march=armv7-a -mfpu=vfpv3-d16  -mfloat-abi=hard
optflags: armv7hnl %{__global_cflags} -march=armv7-a -mfpu=neon  -mfloat-abi=hard

RPM configuration files changing the ABI is highly suspect.

Version-Release number of selected component (if applicable):

How reproducible:

every time

Steps to Reproduce:
1. Look in /usr/lib/rpm/rpmrc and /usr/lib/rpm/redhat/rpmrc.

Actual results:

Expected results:

Additional info:
Comment 1 Panu Matilainen 2014-05-07 06:03:56 EDT
-fsigned-char for ppc dates back to 1997, arm to 1998. Both added with equally little fanfare and non-existent rationale for the selected swithces:

I'd assume there was a reason, but that would be long lost in history at this point. An rpm maintainer is really not in a position to say what flags any given arch should be using, so whatever is there is whatever "arch folks" have sent for inclusion. The latest example being ppc64le, where -fsigned-char has most likely been carried on just because all the other ppc-entries had it:

What is the proper place for all these different kinds of distro-wide settings is a line drawn in sand at best because rpm's idea of an architecture is not identical to the compilers idea of an architecture, and everybody wants to cook their own on top so we have arm-subarchitectures that differ by their floating point ABI only, etc.

All that said, "fixed" upstream now:

Note You need to log in before you can comment on or make changes to this bug.