RPM

rpmio/fnmatch.c needs to provide __builtin_expect for non/old gcc

Bug #1243465 reported by Tim Mooney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RPM
Fix Committed
Medium
Unassigned

Bug Description

building rpm from CVS (updated to 2013-10-22) on x86_64-pc-solaris2.11 (OpenIndiana 151a8) with Oracle Studio 12.3.

rpmio/fnmatch.c uses __builtin_expect, which is apparently a branch-prediction hinter for gcc. Studio doesn't provide such a builtin, so it ends up as an undefined symbol in librpmio.

Doing some web searching, it looks like other versions of fnmatch.c provide a define for __builtin_expect when it's not defined, e.g.

  https://www.virtualbox.org/svn/kbuild-mirror/vendor/grep/2.12/lib/fnmatch.c

Looking back through my rpm build history, it looks like I was using a patch to fnmatch.c going back to at least rpm 5.1.9, but I never reported the issue back then. My bad.

I'm attaching a patch that's a bit of a combination of what modern grep, bison, etc. are using from fnmatch.c and my old patch, that has a specific case for the Studio compiler.

Tags: solaris
Revision history for this message
Tim Mooney (tim-mooney) wrote :
Jeff Johnson (n3npq)
Changed in rpm:
milestone: none → 5.4.14
importance: Undecided → Medium
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.