Menu

#2699 Can't compile SDCC on OpenBSD 6.2

closed-fixed
None
Build
5
2018-04-15
2017-12-29
No

I tried and failed to compile SDCC from current svn on OpenBSD 6.2. Compiling software on OpenBSD tends to be harder than other OSes,a nd I am not really familiar with OpenBSD (I just keep an installation on an old laptop to test SDCC once in a while).

This is not an immediate problem for SDCC users, as OpenBSD 6.2. has packages of the fairly recent SDCC 3.6.0. But this issue might prevent future packaging of SDCC 3.7.0 for OpenBSD.

When I use GCC as the compiler, the boost headers are not found by the configure script, even with -I/usr/local/include in the CXXFLAGS and CPPFLAGS. When I use LLVM 4 or LLVM 5, I see a compiler error (cannot combine with previous 'int' declaration specifier) on the
typedef int __wchar_t;
in line 132 of /usr/include/machine/_types.h, indirectly included from support/librarian/sdcclib.c.

Philipp

Discussion

  • Barry Grumbine

    Barry Grumbine - 2018-03-22

    Hi,

    I am no expert on building software on OpenBSD or otherwise, but I did successfully build SDCC 3.7.0 on OpenBSD 6.2-current (2018-02-16). I expect it should build on 6.2-release as well.

    Today I noticed that OpenBSD's SDCC port was updated from 3.6.0 to 3.7.0 on 2018-03-08, so packaging was not a problem.
    ref: https://github.com/openbsd/ports/tree/master/devel/sdcc

    In case it may help someone in the future, here are my notes for building SDCC on OpenBSD:

    # required packages: (from memory, may need others)
    # subversion - only needed if checking out the tree from sourceforge
    # gmake      - bsd make will not work
    # gcc        - clang in base may work, don't know... gcc and g++
    # g++          are separate packages packages, this is not apparent
    #              from man pages or openports.se
    # bison      - only needed for SDCC 3.7.0, the in-base yack works
    #              as of SDCC r10252
    # automake   - configure doesn't complain but the build fails
    # autoconf     without automake and autoconf installed
    #              select automake v1.15, and autoconf v2.69
    doas pkg_add automake autoconf bison gcc g++ gmake subversion
    
    # get source: download tarball or checkout with subversion
    # https://sourceforge.net/projects/sdcc/files/sdcc/3.7.0/sdcc-src-3.7.0.tar.bz2/download
    # https://sourceforge.net/p/sdcc/code/HEAD/tree/
    # svn co -r10234 https://svn.code.sf.net/p/sdcc/code/trunk sdcc_3.7.0
    
    # not sure if all these are needed but most are
    export CPATH=/usr/local/include
    export CC=/usr/local/bin/egcc
    export CPP=/usr/local/bin/ecpp
    export CXX=/usr/local/bin/eg++
    export CXXCPP=/usr/local/bin/ecpp
    export CPPFLAGS="-I/usr/local/include"
    export LDFLAGS="-L/usr/local/lib"
    export docdir=/usr/local/share/doc/sdcc
    export AUTOMAKE_VERSION=1.15
    export AUTOCONF_VERSION=2.69
    
    ./configure
    
    gmake
    

    Later,
    -Barry

     
  • Philipp Klaus Krause

    I guess the people who do the packagin know OpenBSd well enough. But it would be good if SDCC developers could also easily compile SDCC for OpenBSD. On current OpenBSD 6.3 the use of -fms-extensions seems to be a problem. Let's see if we can get rid of it in SDCC.

    Philipp

     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
     
  • Philipp Klaus Krause

    With -fms-extensions dropped in [r10386], building SDCC on current OpenBSD 6.3 has become easy:

    export MAKE=gmake
    CXX="c++ -I/usr/local/include" CC=cc ./configure
    gmake
    

    Philipp

     

Log in to post a comment.

MongoDB Logo MongoDB