Bug 689480

Summary: Compilation using gfortran44 fails with (Error: unknown pseudo-op: `.cfi_lsda')
Product: Red Hat Enterprise Linux 5 Reporter: Dominik 'Rathann' Mierzejewski <dominik>
Component: gcc44Assignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.5CC: law
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-21 20:04:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
parallel cp2k build configuration
none
serial cp2k build configuration none

Description Dominik 'Rathann' Mierzejewski 2011-03-21 16:06:40 UTC
Created attachment 486634 [details]
parallel cp2k build configuration

Description of problem:
On CentOS 5.5, when compiling cp2k (2_1 stable branch) in smp configuration (with -fopenmp) using gfortran44, compilation fails with
{standard input}: Assembler messages:
{standard input}:48: Error: unknown pseudo-op: `.cfi_lsda'

Configurations for Linux-x86-64-gfortran44.ssmp (parallel) and Linux-x86-64-gfortran44.sopt (serial) are attached.

Version-Release number of selected component (if applicable):
gcc44-gfortran-4.4.0-6.el5

How reproducible:
Always

Steps to Reproduce:
1. put the attached files in cp2k/arch/
2. cd cp2k/makefiles
3. export FORT_C_NAME=gfortran44
4. make OPTFLAGS="%{optflags} -L%{_libdir}/atlas" %{?_smp_mflags} sopt ssmp
  
Actual results:
[...]
gfortran44 -c -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -L/usr/lib64/atlas -ffree-form -fopenmp -D__GFORTRAN -D__FFTSG -D__FFTW3 -D__LIBINT -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6 -D__COMPILE_ARCH="\"Linux-x86-64-gfortran44\"" -D__COMPILE_DATE="\"Fri Mar 11 09:02:52 EST 2011\"" -D__COMPILE_HOST="\"kitsune.icm.edu.pl\"" -D__COMPILE_LASTCVS="\"D/lib////\"" /home/guests/rathann/build/BUILD/cp2k/makefiles/../src/lib/dbcsr_machine.F
{standard input}: Assembler messages:
{standard input}:48: Error: unknown pseudo-op: `.cfi_lsda'
make[2]: *** [dbcsr_machine.o] Error 1
make[2]: Leaving directory `/home/guests/rathann/build/BUILD/cp2k/obj/Linux-x86-64-gfortran44/ssmp'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/home/guests/rathann/build/BUILD/cp2k/makefiles'
make: *** [ssmp] Error 2

Expected results:
Should compile successfully.

Additional info:
The same command without -fopenmp succeeds.

Comment 1 Dominik 'Rathann' Mierzejewski 2011-03-21 16:07:54 UTC
Created attachment 486635 [details]
serial cp2k build configuration

Comment 2 Dominik 'Rathann' Mierzejewski 2011-03-21 16:12:45 UTC
It seems I copied and pasted commands from my specfile (http://pkgs.fedoraproject.org/gitweb/?p=cp2k.git;a=blob;f=cp2k.spec;h=deed774de48ff0b01d0baa6714ff89747fa708cd;hb=el6/master) for cp2k in EL-6 branch, so of course they won't work as-is, so let's make it

4. make OPTFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
 -L/usr/lib64/atlas" sopt ssmp

Comment 3 Jakub Jelinek 2011-03-21 16:24:36 UTC
-fexceptions for Fortran doesn't make much sense.
4.4 still defaulted to using gas .cfi_* even when .cfi_personality/.cfi_lsda wasn't supported when eh_personality_libfunc was NULL and as nothing in Fortran ever said it because Fortran doesn't support exceptions, it will get through.
Either drop -fexceptions, add -fno-exceptions afterwards or use -fno-dwarf2-cfi-asm.

Comment 4 Dominik 'Rathann' Mierzejewski 2011-03-22 12:18:05 UTC
Indeed, removing -fexceptions from OPTFLAGS makes the compilation succeed. Thanks for the tip. I'm downgrading severity to low, since there's a workaround.

Still, if it doesn't make sense, passing -fexceptions to gfortran should fail immediately, not at the asm level with cryptic error message.

Comment 5 Jeff Law 2013-03-21 20:04:32 UTC
There are no plans to fix this bug in Red Hat Enterprise Linux 5.