Re: LLVM 10: lang/crystal

2020-08-03 Thread Wesley Moxam
Providing a new bootstrap won't be a problem (if needed).
It would be great to also bump to the latest crystal version (
https://marc.info/?l=openbsd-ports=159344614726528=2)

-- W

On Mon, Aug 3, 2020 at 5:09 AM Stuart Henderson  wrote:

> On 2020/08/02 20:25, George Koehler wrote:
> > Hi.  This is about OpenBSD ports/lang/crystal.
> >
> > When OpenBSD switches base-clang to LLVM 10, it will add
> > /usr/bin/llvm-config to base.  This will break crystal, because it
> > will run the wrong llvm-config and get a linker error:
> >
> http://build-failures.rhaalovely.net/amd64-clang/2020-08-01/lang/crystal.log
> >
> > This diff fixes crystal for me on amd64, by pointing to the correct
> > llvm-config.  (I don't set REVISION = 0 because both new and old
> > packages use the same llvm-config from ports.)  OK to commit?
>
> OK
>
> > But this only works as long as ports-clang stays at LLVM 8, because
> > the bootstrap crystal.o needs libLLVM-8.so, but we use the libLLVM
> > from llvm-config.  When we update devel/llvm to LLVM 10, then crystal
> > will break, unless someone will provide a new bootstrap.--George
>
> AFAIK base and ports LLVM should be kept in sync, so it will
> likely run into problems again soon.
>
> > Index: Makefile
> > ===
> > RCS file: /cvs/ports/lang/crystal/Makefile,v
> > retrieving revision 1.8
> > diff -u -p -r1.8 Makefile
> > --- Makefile  7 Sep 2019 08:46:41 -   1.8
> > +++ Makefile  2 Aug 2020 23:48:14 -
> > @@ -29,8 +29,9 @@ DISTFILES = crystal-${V}{${V}}.tar.gz \
> >   crystal-${V}-OpenBSD6.5.tar.gz:0 \
> >   shards-${V}{v${V_SHARDS}}.tar.gz:1
> >
> > -# Build requires llvm-config which only exists in ports-clang
> > +# Build requires llvm-config from ports, not from base
> >  COMPILER =   ports-clang
> > +LLVM_CONFIG =${LOCALBASE}/bin/llvm-config
> >
> >  BUILD_DEPENDS =  devel/llvm
> >  RUN_DEPENDS =devel/llvm,-main
> > @@ -49,13 +50,14 @@ NO_TEST = Yes
> >  do-build:
> >   mkdir -p ${WRKSRC}/.build
> >   # Link the compiler from the pre-built bootstrap object
> > - cd ${WRKSRC} && CXX=${CXX} ${MAKE_PROGRAM} llvm_ext libcrystal
> > + cd ${WRKSRC} && CXX=${CXX} LLVM_CONFIG=${LLVM_CONFIG} \
> > + ${MAKE_PROGRAM} llvm_ext libcrystal
> >   cd ${WRKSRC} && ${CXX} -rdynamic -o ${WRKBUILD}/.build/crystal \
> >   ${WRKSRC}/../crystal.o \
> >   ${WRKSRC}/src/llvm/ext/llvm_ext.o \
> >   ${WRKSRC}/src/ext/sigfault.o \
> >   -L${LOCALBASE}/lib \
> > - `(llvm-config --libs --system-libs --ldflags 2>
> /dev/null)` \
> > + `(${LLVM_CONFIG} --libs --system-libs --ldflags 2>
> /dev/null)` \
> >   -lz -lpcre -lgc -lpthread -levent_core -levent_extra -lssl
> \
> >   -lcrypto -liconv
> >   # Use the compiler to re-compile the compiler
> > @@ -63,7 +65,8 @@ do-build:
> >   cd ${WRKSRC}; \
> >   ulimit -s 5120 -d 4096000 && \
> >   CRYSTAL_CONFIG_PATH="lib:${TRUEPREFIX}/lib/crystal" \
> > - CXX=${CXX} ${MAKE_PROGRAM} ${ALL_TARGET}
> > + CXX=${CXX} LLVM_CONFIG=${LLVM_CONFIG} \
> > + ${MAKE_PROGRAM} ${ALL_TARGET}
> >   cd ${WRKSRC}/../shards-${V_SHARDS} && \
> >   ${MAKE_PROGRAM} CRYSTAL=${WRKSRC}/.build/crystal \
> >   CRYSTAL_PATH=${WRKSRC}/src CRFLAGS=--release
> >
>


Re: LLVM 10: lang/crystal

2020-08-03 Thread Stuart Henderson
On 2020/08/02 20:25, George Koehler wrote:
> Hi.  This is about OpenBSD ports/lang/crystal.
> 
> When OpenBSD switches base-clang to LLVM 10, it will add
> /usr/bin/llvm-config to base.  This will break crystal, because it
> will run the wrong llvm-config and get a linker error:
> http://build-failures.rhaalovely.net/amd64-clang/2020-08-01/lang/crystal.log
> 
> This diff fixes crystal for me on amd64, by pointing to the correct
> llvm-config.  (I don't set REVISION = 0 because both new and old
> packages use the same llvm-config from ports.)  OK to commit?

OK

> But this only works as long as ports-clang stays at LLVM 8, because
> the bootstrap crystal.o needs libLLVM-8.so, but we use the libLLVM
> from llvm-config.  When we update devel/llvm to LLVM 10, then crystal
> will break, unless someone will provide a new bootstrap.--George

AFAIK base and ports LLVM should be kept in sync, so it will
likely run into problems again soon.

> Index: Makefile
> ===
> RCS file: /cvs/ports/lang/crystal/Makefile,v
> retrieving revision 1.8
> diff -u -p -r1.8 Makefile
> --- Makefile  7 Sep 2019 08:46:41 -   1.8
> +++ Makefile  2 Aug 2020 23:48:14 -
> @@ -29,8 +29,9 @@ DISTFILES = crystal-${V}{${V}}.tar.gz \
>   crystal-${V}-OpenBSD6.5.tar.gz:0 \
>   shards-${V}{v${V_SHARDS}}.tar.gz:1
>  
> -# Build requires llvm-config which only exists in ports-clang
> +# Build requires llvm-config from ports, not from base
>  COMPILER =   ports-clang
> +LLVM_CONFIG =${LOCALBASE}/bin/llvm-config
>  
>  BUILD_DEPENDS =  devel/llvm
>  RUN_DEPENDS =devel/llvm,-main
> @@ -49,13 +50,14 @@ NO_TEST = Yes
>  do-build:
>   mkdir -p ${WRKSRC}/.build
>   # Link the compiler from the pre-built bootstrap object
> - cd ${WRKSRC} && CXX=${CXX} ${MAKE_PROGRAM} llvm_ext libcrystal
> + cd ${WRKSRC} && CXX=${CXX} LLVM_CONFIG=${LLVM_CONFIG} \
> + ${MAKE_PROGRAM} llvm_ext libcrystal
>   cd ${WRKSRC} && ${CXX} -rdynamic -o ${WRKBUILD}/.build/crystal \
>   ${WRKSRC}/../crystal.o \
>   ${WRKSRC}/src/llvm/ext/llvm_ext.o \
>   ${WRKSRC}/src/ext/sigfault.o \
>   -L${LOCALBASE}/lib \
> - `(llvm-config --libs --system-libs --ldflags 2> /dev/null)` \
> + `(${LLVM_CONFIG} --libs --system-libs --ldflags 2> /dev/null)` \
>   -lz -lpcre -lgc -lpthread -levent_core -levent_extra -lssl \
>   -lcrypto -liconv
>   # Use the compiler to re-compile the compiler
> @@ -63,7 +65,8 @@ do-build:
>   cd ${WRKSRC}; \
>   ulimit -s 5120 -d 4096000 && \
>   CRYSTAL_CONFIG_PATH="lib:${TRUEPREFIX}/lib/crystal" \
> - CXX=${CXX} ${MAKE_PROGRAM} ${ALL_TARGET}
> + CXX=${CXX} LLVM_CONFIG=${LLVM_CONFIG} \
> + ${MAKE_PROGRAM} ${ALL_TARGET}
>   cd ${WRKSRC}/../shards-${V_SHARDS} && \
>   ${MAKE_PROGRAM} CRYSTAL=${WRKSRC}/.build/crystal \
>   CRYSTAL_PATH=${WRKSRC}/src CRFLAGS=--release
> 



LLVM 10: lang/crystal

2020-08-02 Thread George Koehler
Hi.  This is about OpenBSD ports/lang/crystal.

When OpenBSD switches base-clang to LLVM 10, it will add
/usr/bin/llvm-config to base.  This will break crystal, because it
will run the wrong llvm-config and get a linker error:
http://build-failures.rhaalovely.net/amd64-clang/2020-08-01/lang/crystal.log

This diff fixes crystal for me on amd64, by pointing to the correct
llvm-config.  (I don't set REVISION = 0 because both new and old
packages use the same llvm-config from ports.)  OK to commit?

But this only works as long as ports-clang stays at LLVM 8, because
the bootstrap crystal.o needs libLLVM-8.so, but we use the libLLVM
from llvm-config.  When we update devel/llvm to LLVM 10, then crystal
will break, unless someone will provide a new bootstrap.--George

Index: Makefile
===
RCS file: /cvs/ports/lang/crystal/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile7 Sep 2019 08:46:41 -   1.8
+++ Makefile2 Aug 2020 23:48:14 -
@@ -29,8 +29,9 @@ DISTFILES =   crystal-${V}{${V}}.tar.gz \
crystal-${V}-OpenBSD6.5.tar.gz:0 \
shards-${V}{v${V_SHARDS}}.tar.gz:1
 
-# Build requires llvm-config which only exists in ports-clang
+# Build requires llvm-config from ports, not from base
 COMPILER = ports-clang
+LLVM_CONFIG =  ${LOCALBASE}/bin/llvm-config
 
 BUILD_DEPENDS =devel/llvm
 RUN_DEPENDS =  devel/llvm,-main
@@ -49,13 +50,14 @@ NO_TEST =   Yes
 do-build:
mkdir -p ${WRKSRC}/.build
# Link the compiler from the pre-built bootstrap object
-   cd ${WRKSRC} && CXX=${CXX} ${MAKE_PROGRAM} llvm_ext libcrystal
+   cd ${WRKSRC} && CXX=${CXX} LLVM_CONFIG=${LLVM_CONFIG} \
+   ${MAKE_PROGRAM} llvm_ext libcrystal
cd ${WRKSRC} && ${CXX} -rdynamic -o ${WRKBUILD}/.build/crystal \
${WRKSRC}/../crystal.o \
${WRKSRC}/src/llvm/ext/llvm_ext.o \
${WRKSRC}/src/ext/sigfault.o \
-L${LOCALBASE}/lib \
-   `(llvm-config --libs --system-libs --ldflags 2> /dev/null)` \
+   `(${LLVM_CONFIG} --libs --system-libs --ldflags 2> /dev/null)` \
-lz -lpcre -lgc -lpthread -levent_core -levent_extra -lssl \
-lcrypto -liconv
# Use the compiler to re-compile the compiler
@@ -63,7 +65,8 @@ do-build:
cd ${WRKSRC}; \
ulimit -s 5120 -d 4096000 && \
CRYSTAL_CONFIG_PATH="lib:${TRUEPREFIX}/lib/crystal" \
-   CXX=${CXX} ${MAKE_PROGRAM} ${ALL_TARGET}
+   CXX=${CXX} LLVM_CONFIG=${LLVM_CONFIG} \
+   ${MAKE_PROGRAM} ${ALL_TARGET}
cd ${WRKSRC}/../shards-${V_SHARDS} && \
${MAKE_PROGRAM} CRYSTAL=${WRKSRC}/.build/crystal \
CRYSTAL_PATH=${WRKSRC}/src CRFLAGS=--release