Bug 819333

Summary: flint defines ulong as a macro, conflicting with system definition
Product: [Fedora] Fedora Reporter: Paulo Andrade <paulo.cesar.pereira.de.andrade>
Component: flintAssignee: Conrad Meyer <cse.cem+redhatbugz>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: cse.cem+redhatbugz, loganjerry, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-26 07:11:36 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:
Attachments:
Description Flags
flint-1.6-ulong.patch none

Description Paulo Andrade 2012-05-06 17:20:10 UTC
Created attachment 582476 [details]
flint-1.6-ulong.patch

In my current work on porting sagemath to Fedora, the build failure is:

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/pcpa/rpmbuild/BUILDROOT/sagemath-5.0.rc0-1.x86_64/usr/share/sagemath/local/include/FLINT/ -Isage/libs/flint/ -I/home/pcpa/rpmbuild/BUILDROOT/sagemath-5.0.rc0-1.x86_64/usr/share/sagemath/local/include -Ic_lib/include -I/home/pcpa/rpmbuild/BUILDROOT/sagemath-5.0.rc0-1.x86_64/usr/share/sagemath/devel/sage/sage/ext -I/usr/include/python2.7 -c sage/libs/flint/fmpq_poly.c -o build/temp.linux-x86_64-2.7/sage/libs/flint/fmpq_poly.o -std=c99 -D_XPG6 -w
In file included from /usr/include/stdlib.h:320:0,
                 from /usr/include/zn_poly/zn_poly.h:31,
                 from /home/pcpa/rpmbuild/BUILDROOT/sagemath-5.0.rc0-1.x86_64/usr/share/sagemath/local/include/FLINT/fmpz.h:39,
                 from sage/libs/flint/fmpq_poly.h:21,
                 from sage/libs/flint/fmpq_poly.c:15:
/usr/include/sys/types.h:151:27: error: duplicate 'unsigned'
error: command 'gcc' failed with exit status 1

  I am currently using fedora 16, but the problem will happen in any
current fedora.

  This pseudo patch to flint.h corrects it:

-#define ulong unsigned long
+typedef unsigned long ulong;

as gcc will then not cause an error in sys/types.h for the redefined
but identical typedef; code in sys/type.h looks like:

#ifdef __USE_MISC
/* Old compatibility names for C types.  */
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
#endif

  I rebuilt flint with the attached patch, to continue my work on
sagemath port to fedora.

Comment 1 Fedora Update System 2012-05-07 19:28:54 UTC
flint-1.6-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/flint-1.6-3.fc17

Comment 2 Fedora Update System 2012-05-07 22:26:32 UTC
Package flint-1.6-3.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing flint-1.6-3.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-7462/flint-1.6-3.fc17
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2012-05-26 07:11:36 UTC
flint-1.6-3.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.