Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1523401

Summary: bad code generated on s390x
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: annobinAssignee: Nick Clifton <nickc>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: fweimer, hannsj_uhl, nickc
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: annobin-2.5.1-4.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-20 14:43:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 467765, 1502660    

Description Dan Horák 2017-12-07 21:36:31 UTC
Description of problem:
We see build failure in the s390utils packages.

Version-Release number of selected component (if applicable):
annobin-2.5.1-3.fc28.s390x

How reproducible:
100%

Steps to Reproduce:
1. printf "#include <%s>\n int main(void) {return 0;}"  "fuse.h" | ( gcc -DS390_TOOLS_RELEASE=2.2.0-1.fc28 -DS390_TOOLS_LIBDIR=/lib/s390-tools -DS390_TOOLS_DATADIR=/usr/share/s390-tools -DS390_TOOLS_SYSCONFDIR=/etc -DS390_TOOLS_BINDIR=/usr/sbin -g -rdynamic -fstack-protector-all -W -Wall -Wformat-security -O3 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -DHAVE_FUSE=1 -I/usr/include/fuse -D_FILE_OFFSET_BITS=64 -I ../include -D_GNU_SOURCE -xc - )



Actual results:
{standard input}: Assembler messages:
{standard input}:4: Error: unrecognized symbol type ""
{standard input}:5: Error: junk at end of line, first unrecognized character is `:'


Expected results:
no error


Additional info:
The reproducer is expanded from https://github.com/ibm-s390-tools/s390-tools/blob/master/zdump/Makefile#L12

Removing -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 makes the gcc command succeed.

The generated assembler code looks like

	.file	""
	.machinemode zarch
	.machine "zEC12"
.type  STT_OBJECT
:
	.pushsection .gnu.build.attributes, "", %note
	.balign 4
	.pushsection .gnu.build.attributes
	.dc.l 8 	# namesz = strlen (GA$2p2)
	.dc.l 8		# descsz = sizeof (address)
	.dc.l 0x100	# type = OPEN
	.asciz "GA$2p2"	# name (string: version)
	.quad 	# description (symbol name)
	.popsection

	.pushsection .gnu.build.attributes
	.dc.l 23 	# namesz = strlen (GA$gcc 7.2.1 20170915)
	.dc.l 0		# no description
	.dc.l 0x100	# type = OPEN
	.asciz "GA$gcc 7.2.1 20170915"	# name (string: build-tool)
	.dc.b 0 	# Padding
	.popsection
...

Comment 1 Nick Clifton 2017-12-08 11:31:13 UTC
Hi Dan,

  The problem was the piped input.  The annobin plugin was not expecting this
  and so it generated an assembler symbol name that was completely empty.  I
  have checked in a patch to check for this situation so the problem should
  now be resolved.  Please could you try out: annobin-2.5.1-4.fc28 and let
  me know if the problem still exists.

Cheers
  Nick

Comment 2 Dan Horák 2017-12-08 19:34:29 UTC
Hi Nick, yup, the updated annobin fixes the problem. Thanks.