[GHC] #12802: prototype mismatch with EFF_ from unregisterisered GHC when building ieee754

#12802: prototype mismatch with EFF_ from unregisterisered GHC when building ieee754 -------------------------------------+------------------------------------- Reporter: clint | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Linux Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Where building ieee754 succeeded with GHC 7.10, it fails with 8.0 on platforms without registerised builds, for example arm64: {{{ [1 of 2] Compiling Numeric.IEEE ( Numeric/IEEE.hs, dist- ghc/build/Numeric/IEEE.o ) In file included from /tmp/ghc8e40_0/ghc_2.hc:3:0: error: /tmp/ghc8e40_0/ghc_2.hc:2448:6: error: error: conflicting types for 'nextup' EFF_(nextup); ^ /usr/lib/ghc/include/Stg.h:228:24: error: note: in definition of macro 'EFF_' #define EFF_(f) void f() /* See Note [External function prototypes] */ ^ In file included from /usr/include/features.h:364:0: error: 0, from /usr/include/math.h:26, from /usr/lib/ghc/include/Stg.h:74, from /tmp/ghc8e40_0/ghc_2.hc:3: /usr/include/aarch64-linux-gnu/bits/mathcalls.h:301:1: error: note: previous declaration of 'nextup' was here __MATHCALL (nextup,, (_Mdouble_ __x)); ^ In file included from /tmp/ghc8e40_0/ghc_2.hc:3:0: error: /tmp/ghc8e40_0/ghc_2.hc:2501:6: error: error: conflicting types for 'nextup' EFF_(nextup); ^ /usr/lib/ghc/include/Stg.h:228:24: error: note: in definition of macro 'EFF_' #define EFF_(f) void f() /* See Note [External function prototypes] */ ^ In file included from /usr/include/features.h:364:0: error: 0, from /usr/include/math.h:26, from /usr/lib/ghc/include/Stg.h:74, from /tmp/ghc8e40_0/ghc_2.hc:3: /usr/include/aarch64-linux-gnu/bits/mathcalls.h:301:1: error: note: previous declaration of 'nextup' was here __MATHCALL (nextup,, (_Mdouble_ __x)); ^ In file included from /tmp/ghc8e40_0/ghc_2.hc:3:0: error: /tmp/ghc8e40_0/ghc_2.hc:2554:6: error: error: conflicting types for 'nextupf' EFF_(nextupf); ^ /usr/lib/ghc/include/Stg.h:228:24: error: note: in definition of macro 'EFF_' #define EFF_(f) void f() /* See Note [External function prototypes] */ ^ In file included from /usr/lib/ghc/include/Stg.h:74:0: error: 0, from /tmp/ghc8e40_0/ghc_2.hc:3: /usr/include/aarch64-linux-gnu/bits/mathcalls.h:301:1: error: note: previous declaration of 'nextupf' was here __MATHCALL (nextup,, (_Mdouble_ __x)); ^ In file included from /tmp/ghc8e40_0/ghc_2.hc:3:0: error: /tmp/ghc8e40_0/ghc_2.hc:2607:6: error: error: conflicting types for 'nextupf' EFF_(nextupf); ^ /usr/lib/ghc/include/Stg.h:228:24: error: note: in definition of macro 'EFF_' #define EFF_(f) void f() /* See Note [External function prototypes] */ ^ In file included from /usr/lib/ghc/include/Stg.h:74:0: error: 0, from /tmp/ghc8e40_0/ghc_2.hc:3: /usr/include/aarch64-linux-gnu/bits/mathcalls.h:301:1: error: note: previous declaration of 'nextupf' was here __MATHCALL (nextup,, (_Mdouble_ __x)); ^ In file included from /tmp/ghc8e40_0/ghc_2.hc:3:0: error: /tmp/ghc8e40_0/ghc_2.hc:2660:6: error: error: conflicting types for 'nextdown' EFF_(nextdown); ^ /usr/lib/ghc/include/Stg.h:228:24: error: note: in definition of macro 'EFF_' #define EFF_(f) void f() /* See Note [External function prototypes] */ ^ In file included from /usr/include/features.h:364:0: error: 0, from /usr/include/math.h:26, from /usr/lib/ghc/include/Stg.h:74, from /tmp/ghc8e40_0/ghc_2.hc:3: /usr/include/aarch64-linux-gnu/bits/mathcalls.h:299:1: error: note: previous declaration of 'nextdown' was here __MATHCALL (nextdown,, (_Mdouble_ __x)); ^ In file included from /tmp/ghc8e40_0/ghc_2.hc:3:0: error: /tmp/ghc8e40_0/ghc_2.hc:2713:6: error: error: conflicting types for 'nextdown' EFF_(nextdown); ^ /usr/lib/ghc/include/Stg.h:228:24: error: note: in definition of macro 'EFF_' #define EFF_(f) void f() /* See Note [External function prototypes] */ ^ In file included from /usr/include/features.h:364:0: error: 0, from /usr/include/math.h:26, from /usr/lib/ghc/include/Stg.h:74, from /tmp/ghc8e40_0/ghc_2.hc:3: /usr/include/aarch64-linux-gnu/bits/mathcalls.h:299:1: error: note: previous declaration of 'nextdown' was here __MATHCALL (nextdown,, (_Mdouble_ __x)); ^ In file included from /tmp/ghc8e40_0/ghc_2.hc:3:0: error: /tmp/ghc8e40_0/ghc_2.hc:2766:6: error: error: conflicting types for 'nextdownf' EFF_(nextdownf); ^ /usr/lib/ghc/include/Stg.h:228:24: error: note: in definition of macro 'EFF_' #define EFF_(f) void f() /* See Note [External function prototypes] */ ^ In file included from /usr/lib/ghc/include/Stg.h:74:0: error: 0, from /tmp/ghc8e40_0/ghc_2.hc:3: /usr/include/aarch64-linux-gnu/bits/mathcalls.h:299:1: error: note: previous declaration of 'nextdownf' was here __MATHCALL (nextdown,, (_Mdouble_ __x)); ^ In file included from /tmp/ghc8e40_0/ghc_2.hc:3:0: error: /tmp/ghc8e40_0/ghc_2.hc:2819:6: error: error: conflicting types for 'nextdownf' EFF_(nextdownf); ^ /usr/lib/ghc/include/Stg.h:228:24: error: note: in definition of macro 'EFF_' #define EFF_(f) void f() /* See Note [External function prototypes] */ ^ In file included from /usr/lib/ghc/include/Stg.h:74:0: error: 0, from /tmp/ghc8e40_0/ghc_2.hc:3: /usr/include/aarch64-linux-gnu/bits/mathcalls.h:299:1: error: note: previous declaration of 'nextdownf' was here __MATHCALL (nextdown,, (_Mdouble_ __x)); ^ `gcc' failed in phase `C Compiler'. (Exit code: 1) }}} {{{ [("Project name","The Glorious Glasgow Haskell Compilation System") ,("GCC extra via C opts"," -fwrapv -fno-builtin") ,("C compiler command","/usr/bin/gcc") ,("C compiler flags"," -fno-stack-protector") ,("C compiler link flags"," -fuse-ld=gold -Wl,-z,noexecstack") ,("Haskell CPP command","/usr/bin/gcc") ,("Haskell CPP flags","-E -undef -traditional") ,("ld command","/usr/bin/ld.gold") ,("ld flags"," -z noexecstack") ,("ld supports compact unwind","YES") ,("ld supports build-id","YES") ,("ld supports filelist","NO") ,("ld is GNU ld","YES") ,("ar command","/usr/bin/ar") ,("ar flags","q") ,("ar supports at file","YES") ,("touch command","touch") ,("dllwrap command","/bin/false") ,("windres command","/bin/false") ,("libtool command","libtool") ,("perl command","/usr/bin/perl") ,("cross compiling","NO") ,("target os","OSLinux") ,("target arch","ArchARM64") ,("target word size","8") ,("target has GNU nonexec stack","True") ,("target has .ident directive","True") ,("target has subsections via symbols","False") ,("Unregisterised","YES") ,("LLVM llc command","llc-3.7") ,("LLVM opt command","opt-3.7") ,("Project version","8.0.1") ,("Project Git commit id","4986837f8168cacf95c24fecc84d7b36c47f3c11") ,("Booter version","7.10.3") ,("Stage","2") ,("Build platform","aarch64-unknown-linux") ,("Host platform","aarch64-unknown-linux") ,("Target platform","aarch64-unknown-linux") ,("Have interpreter","YES") ,("Object splitting supported","NO") ,("Have native code generator","NO") ,("Support SMP","NO") ,("Tables next to code","YES") ,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn thr_debug_p") ,("RTS expects libdw","NO") ,("Support dynamic-too","YES") ,("Support parallel --make","YES") ,("Support reexported-modules","YES") ,("Support thinning and renaming package flags","YES") ,("Requires unified installed package IDs","YES") ,("Uses package keys","YES") ,("Uses unit IDs","YES") ,("Dynamic by default","NO") ,("GHC Dynamic","YES") ,("GHC Profiled","NO") ,("Leading underscore","NO") ,("Debug on","False") ,("LibDir","/usr/lib/ghc") ,("Global Package DB","/usr/lib/ghc/package.conf.d") ] }}} The same is true for mips64el, s390x, alpha, hppa, m68k, sh4, sparc64, and I imagine mips and mipsel as well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12802 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12802: prototype mismatch with EFF_ from unregisterisered GHC when building ieee754 -------------------------------------+------------------------------------- Reporter: clint | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by slyfox): * cc: slyfox (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12802#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12802: prototype mismatch with EFF_ from unregisterisered GHC when building ieee754 -------------------------------------+------------------------------------- Reporter: clint | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by slyfox): I think it was broken not by GHC but by a new libc that started exposing primitives named the same way. To stop GHC emitting incompatible proto we can add next* functions to whitelist: {{{ compiler/cmm/CLabel.hs-math_funs = mkUniqSet [ compiler/cmm/CLabel.hs- -- _ISOC99_SOURCE compiler/cmm/CLabel.hs- (fsLit "acos"), (fsLit "acosf"), (fsLit "acosh"), compiler/cmm/CLabel.hs- (fsLit "acoshf"), (fsLit "acoshl"), (fsLit "acosl"), }}} But I suspect it won't help you as ieee754 actually redefines at least 'nextup'. As a workaround ieee754 might like to rename C symbols to at least not clast with libc symbols. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12802#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12802: prototype mismatch with EFF_ from unregisterisered GHC when building
ieee754
-------------------------------------+-------------------------------------
Reporter: clint | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Linux | Architecture:
Type of failure: Incorrect result | Unknown/Multiple
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12802: prototype mismatch with EFF_ from unregisterisered GHC when building ieee754 -------------------------------------+------------------------------------- Reporter: clint | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12802#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC