
Hi I attempt to build head today on OpenBSD current and failed, but i not sure where to start to fix the problems. The full configure and build logs are attached. Just a note: ghc-8.0 builds fine, ghc-8.2 fails with the same error. the first error is "inplace/bin/ghc-stage1" -optc-std=gnu99 -optc-fno-stack-protector -optc-Wall -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Wi nline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedcons tants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist/build/./autogen -optc- O2 -optc-fomit-frame-pointer -optc-g -optc-DRtsWay=\"rts_v\" -optc-ffunction-sections -optc-fdata-sections -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconsta nts/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wnoncanonical-monad-instances -c rts/Timer.c -o rts/dist/build/Timer.o In file included from rts/posix/Signals.h:13, from rts/RtsSignals.h:14, from rts/Timer.c:26:0: error: /usr/include/signal.h:72:0: error: warning: redundant redeclaration of '__errno' | 72 | extern int *__errno(void); | ^ and the last error is rts/linker/Elf.c:539:0: error: warning: unused variable 'secno' | 539 | Elf_Word secno = stab[j].st_shndx; | ^ `gcc' failed in phase `C Compiler'. (Exit code: 1) gmake[1]: *** [rts/ghc.mk:248: rts/dist/build/linker/Elf.o] Error 1 gmake: *** [Makefile:127: all] Error 2

On Sun, 26 Mar 2017 19:24:07 +0800
Adam Steen
Hi
I attempt to build head today on OpenBSD current and failed, but i not sure where to start to fix the problems. The full configure and build logs are attached. Just a note: ghc-8.0 builds fine, ghc-8.2 fails with the same error.
the first error is ... rts/linker/Elf.c:539:0: error: warning: unused variable 'secno'
There are just warnings. I think the real error is: rts/linker/Elf.c:402:0: error: error: (Each undeclared identifier is reported only once | 402 | case EM_PPC64: IF_DEBUG(linker,debugBelch( "powerpc64" )); | ^ I guess openbsd does not have definition of EM_PPC64 (yet?). Try that to see how far it progresses: diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c index 604c3dc..e8f6aab 100644 --- a/rts/linker/Elf.c +++ b/rts/linker/Elf.c @@ -400,8 +400,10 @@ ocVerifyImage_ELF ( ObjectCode* oc ) #endif case EM_PPC: IF_DEBUG(linker,debugBelch( "powerpc32" )); break; +#ifdef EM_PPC64 case EM_PPC64: IF_DEBUG(linker,debugBelch( "powerpc64" )); errorBelch("%s: RTS linker not implemented on PowerPC 64-bit", oc->fileName); return 0; +#endif #ifdef EM_X86_64 case EM_X86_64: IF_DEBUG(linker,debugBelch( "x86_64" )); break; -- Sergei

On 03/26/17 03:04 PM, Sergei Trofimovich wrote:
I guess openbsd does not have definition of EM_PPC64 (yet?).
IIRC it does not. I even remembering to fix this in the past but then probably forgotten to submit patch... Anyway, attempting to duplicate on outdated OpenBSD current from Dec 2016, but still post 6.0 code so this should be ok... Karel

On Sun, 26 Mar 2017 15:08:50 +0200
Karel Gardas
On 03/26/17 03:04 PM, Sergei Trofimovich wrote:
I guess openbsd does not have definition of EM_PPC64 (yet?).
IIRC it does not. I even remembering to fix this in the past but then probably forgotten to submit patch...
Anyway, attempting to duplicate on outdated OpenBSD current from Dec 2016, but still post 6.0 code so this should be ok...
I've tested the following patch https://git.haskell.org/ghc.git/commitdiff/6c73504ac5f4e951062d5e868fa2b69b0... on amd64-unknown-openbsd6.0. Hope it does not breaks things for you. -- Sergei

On 03/26/17 04:54 PM, Sergei Trofimovich wrote:
On Sun, 26 Mar 2017 15:08:50 +0200 Karel Gardas
wrote: On 03/26/17 03:04 PM, Sergei Trofimovich wrote:
I guess openbsd does not have definition of EM_PPC64 (yet?).
IIRC it does not. I even remembering to fix this in the past but then probably forgotten to submit patch...
Anyway, attempting to duplicate on outdated OpenBSD current from Dec 2016, but still post 6.0 code so this should be ok...
I've tested the following patch https://git.haskell.org/ghc.git/commitdiff/6c73504ac5f4e951062d5e868fa2b69b0... on amd64-unknown-openbsd6.0.
Hope it does not breaks things for you.
Well, my patch looks exactly like yours. Anyway, thanks for such fast solution and commit. Karel

Karel Gardas
On 03/26/17 04:54 PM, Sergei Trofimovich wrote:
On Sun, 26 Mar 2017 15:08:50 +0200 Karel Gardas
wrote: On 03/26/17 03:04 PM, Sergei Trofimovich wrote:
I guess openbsd does not have definition of EM_PPC64 (yet?).
IIRC it does not. I even remembering to fix this in the past but then probably forgotten to submit patch...
Anyway, attempting to duplicate on outdated OpenBSD current from Dec 2016, but still post 6.0 code so this should be ok...
I've tested the following patch https://git.haskell.org/ghc.git/commitdiff/6c73504ac5f4e951062d5e868fa2b69b0... on amd64-unknown-openbsd6.0.
Hope it does not breaks things for you.
Well, my patch looks exactly like yours. Anyway, thanks for such fast solution and commit.
I have cherry-picked the fix into 8.2 as d4694b85be23c8a014225271060765c062502ed2. Cheers, - Ben
participants (4)
-
Adam Steen
-
Ben Gamari
-
Karel Gardas
-
Sergei Trofimovich