Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test MSYS2 build variants #1547

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Test MSYS2 build variants #1547

wants to merge 3 commits into from

Conversation

umarcor
Copy link
Member

@umarcor umarcor commented Dec 25, 2020

This PR is not to be merged, but for showing some issues when trying multiple build options on MSYS2:

Default

This is the PKGBUILD upstreamed to msys2/MINGW-packages. It generates two packages: ghdl-mcode for MINGW32 and ghdl-llvm for MINGW64. It is tested as a reference, since it is known to work.

Clang

Same PKGBUILD as the 'Default', but using Clang instead of GCC by setting the following envvars:

export CC=clang
export CXX=clang++

On MINGW32 (mcode), the build fails because the machine is not detected properly:

Unsupported i686-w64-windows-gnu build for mcode

I could fix that by patching configure (see commit msys2: fix MINGW32 detection). However, the build then fails with:

 clang -c -g -DWITH_GNAT_RUN_TIME -o chkstk.o D:/a/ghdl/ghdl/msys2/clang/src/build-i686/../../../../src/grt/config/chkstk.S
D:/a/ghdl/ghdl/msys2/clang/src/build-i686/../../../../src/grt/config/chkstk.S:52:2: error: unknown directive
 .ident "Written by T.Gingold"
 ^
make: *** [../../../../src/grt/Makefile.inc:228: chkstk.o] Error 1

On MINGW64 (LLVM), the build is successful, but the testsuite needs to be executed with CC=gcc, otherwise bug097 fails with:

gna bug097: failed
/mingw64/bin/clang
clang: error: unsupported option '-fPIC' for target 'x86_64-w64-windows-gnu'

LLVM

Instead of using different backends, in this case LLVM is used both on MINGW32 and MINGW64. The compiler is GCC.

On MINGW64, the build is successful and the testsuite too. In fact, this is the same context as the Default.

On MINGW32, the build fails with a not very meaningful error:

gcc -c -g -gnatecD:/a/ghdl/ghdl/msys2/llvm/src/build-i686/../../../../src/grt/grt.adc -gnatdY run-bind.adb
gnatmake: "run-bind.adb" compilation error
make: *** [../../../../src/grt/Makefile.inc:153: grt/run-bind.o] Error 4

Static

Same PKGBUILD as the 'Default', with libghdl_static.diff patch borrowed from open-tool-forge/fpga-toolchain.

On MINGW32 (mcode), the build and the testsuite are successful.

On MINGW64 (LLVM), the build is successful but the first sanity test fails with:

sanity 000hello: failed
  analyze hello.vhdl
  elaborate and simulate hello
  D:/a/_temp/msys/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\a\ghdl\ghdl\msys2\static\src\build-x86_64\lib/ghdl/libgrt.a(grt-vcdz.o): in function `grt__vcdz__my_vcd_put':
  D:/a/ghdl/ghdl/src/grt/grt-vcdz.adb:43: undefined reference to `gzwrite'
  D:/a/_temp/msys/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\a\ghdl\ghdl\msys2\static\src\build-x86_64\lib/ghdl/libgrt.a(grt-vcdz.o): in function `grt__vcdz__my_vcd_putc':
  D:/a/ghdl/ghdl/src/grt/grt-vcdz.adb:51: undefined reference to `gzputc'
  D:/a/_temp/msys/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\a\ghdl\ghdl\msys2\static\src\build-x86_64\lib/ghdl/libgrt.a(grt-vcdz.o): in function `grt__vcdz__my_vcd_close':
  D:/a/ghdl/ghdl/src/grt/grt-vcdz.adb:56: undefined reference to `gzclose'
  D:/a/_temp/msys/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\a\ghdl\ghdl\msys2\static\src\build-x86_64\lib/ghdl/libgrt.a(grt-vcdz.o): in function `grt__vcdz__vcdz_option':
...

LLVM static

Mixture of 'LLVM' and 'Static'. An attempt at generating static builds with LLVM backend on both MINGW32 and MINGW64.

On MINGW64, the build is successful but the first sanity test fails as in case 'Static'.

On MINGW32, the build fails as in case 'LLVM'.

@umarcor umarcor marked this pull request as draft December 25, 2020 04:17
@eine eine added Arch: amd64 Alternative: x86-64, Intel 64 (EM64T) Arch: i386 Alternative: x86-32 Backend: LLVM GHDL using Low-Level Virtual Machine for code generation Backend: mcode GHDL using in-memory code generation OS: Windows (MinGW) Package: Windows - MinGW (PKGBUILD) labels Dec 25, 2020
@umarcor umarcor changed the title TEST MSYS2 BUILDSMsys2/tests Test MSYS2 build variants Dec 27, 2020
@umarcor umarcor force-pushed the msys2/tests branch 4 times, most recently from 4a63bb5 to 05b8c12 Compare December 30, 2020 05:45
@umarcor umarcor force-pushed the msys2/tests branch 4 times, most recently from e653448 to 43fdaef Compare January 1, 2021 17:48
@umarcor umarcor force-pushed the msys2/tests branch 3 times, most recently from ed1e8ad to dc33ad5 Compare January 6, 2021 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: amd64 Alternative: x86-64, Intel 64 (EM64T) Arch: i386 Alternative: x86-32 Backend: LLVM GHDL using Low-Level Virtual Machine for code generation Backend: mcode GHDL using in-memory code generation OS: Windows (MinGW) Package: Windows - MinGW (PKGBUILD)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants