Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,251
    • Issues 4,251
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 394
    • Merge Requests 394
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15945

Closed
Open
Opened Nov 24, 2018 by klomeli@trac-klomeli

Unable to compile GHC from source: redefinition of '_DYNAMIC' as different kind of symbol

I am running the following script to build GHC from sources (ghc-8.6.2-src.tar.xz) on OpenBSD (-CURRENT):

{{{ #! /bin/sh set -e

BUILD_DIR=/usr/local/tmp-build-ghc

export AUTOCONF_VERSION=2.69 export AUTOMAKE_VERSION=1.16

if [ ! -n "$1" ]; then

echo "ERROR: Provide path for ghc source."

exit 1

fi

echo "Extracting ghc source files from ${1} to ${BUILD_DIR} ..." mkdir -p $BUILD_DIR

cd $BUILD_DIR xzcat $1 | tar xvf -

GHC_DIR=ls | grep ghc cd $GHC_DIR

echo "Cleaning up OpenBSD-incompatible commands..." find . -type f | xargs sed -i -e 's|^ln -f -v |ln -f |'

echo "Building GHC... " export CC=/usr/bin/clang

  1. /boot
  2. /configure --with-iconv-libraries=/usr/local/lib \

--with-iconv-includes=/usr/local/include \

--with-gmp-libraries=/usr/local/lib \

--with-gmp-includes=/usr/local/include \

--with-ffi-libraries=/usr/local/lib \

--with-ffi-includes=/usr/local/include \

--with-system-libffi

gmake }}}

I have filed a separate bug report for the **ln** incompatibility with the unsupported **-v** flag.

When compiling GHC, I get the following error:

...

"inplace/bin/ghc-stage1" -optc-fno-stack-protector -optc-Wall -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Wundef -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-DFS_NAMESPACE=rts -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist/build/./autogen -optc-Wno-unknown-pragmas -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-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -DFS_NAMESPACE=rts -this-unit-id rts -dcmm-lint      -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen            -O2 -Wcpp-undef    -Wnoncanonical-monad-instances  -c rts/RtsSymbols.c -o rts/dist/build/RtsSymbols.o

rts/RtsSymbols.c:990:1: error:
     error: redefinition of '_DYNAMIC' as different kind of symbol
    |
990 | RTS_OPENBSD_ONLY_SYMBOLS
    | ^
RTS_OPENBSD_ONLY_SYMBOLS
^

rts/RtsSymbols.c:283:22: error:
     note: expanded from macro 'RTS_OPENBSD_ONLY_SYMBOLS'
         SymE_NeedsProto(_DYNAMIC)
                         ^
    |
283 |      SymE_NeedsProto(_DYNAMIC)
    |                      ^

/usr/include/sys/exec_elf.h:765:17: error:
     note: previous definition is here
    |
765 | extern Elf_Dyn          _DYNAMIC[];
    |                 ^
extern Elf_Dyn          _DYNAMIC[];
                        ^
1 error generated.
`clang' failed in phase `C Compiler'. (Exit code: 1)
gmake[1]: *** [rts/ghc.mk:315: rts/dist/build/RtsSymbols.o] Error 1
gmake: *** [Makefile:127: all] Error 2

Any suggestions appreciated. Thanks!

Edited Mar 10, 2019 by klomeli
Assignee
Assign to
8.8.1
Milestone
8.8.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#15945