!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

398 Members
92 Servers

Load older messages


SenderMessageTime
6 Oct 2024
@suskeyhose:matrix.orgsrasuok, now I'm back to more or less where I was, the environment builds and compilation works fine, but it can't link because it's missing the output of BlocksRuntime, so I just need to figure out the best way to make sure that gets properly set up for the windows build to produce the right thing18:03:27
@artturin:matrix.orgArtturinThe package uses a revision from 201418:04:30
@artturin:matrix.orgArtturinhttps://github.com/mackyle/blocksruntime/commit/c524e1747f546e7b2c215e7a063699b11bb9668518:04:35
@artturin:matrix.orgArtturinMaybe you need this18:04:38
@artturin:matrix.orgArtturinwell you override already18:04:45
@artturin:matrix.orgArtturinnvm18:04:45
@suskeyhose:matrix.orgsrasuYeah, I've got it updated to the latest version and I'm getting it set up, the main issue is just making sure that it's producing the right kind of library that my makefiles expect, and that clang finds it, seeing as I'm always double-checking myself to see if it needs something like BlocksRuntime.dll or libBlocksRuntime.so or whatever when it's cross compiled18:05:29
@artturin:matrix.orgArtturinI doubt the person who created this thought about windows at all18:06:20
@artturin:matrix.orgArtturinHomemade build scripts18:06:35
@suskeyhose:matrix.orgsrasuI've gotten it to build and work under wine on arch18:06:49
@artturin:matrix.orgArtturin
In reply to @artturin:matrix.org
https://github.com/mackyle/blocksruntime/commit/c524e1747f546e7b2c215e7a063699b11bb96685
The package doens't build/install .so by default
18:10:19
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/pull/34691318:18:14
@suskeyhose:matrix.orgsrasuthanks!18:18:25
@suskeyhose:matrix.orgsrasuI'm adding an override to the build and install steps to pass -shared which does install the .so18:18:36
@artturin:matrix.orgArtturinThere is a difference in the shared lib when using gcc vs clang18:18:38
@artturin:matrix.orgArtturinDunno if it's meaningful18:19:13
@artturin:matrix.orgArtturin * There are differences in the shared lib when using gcc vs clang18:19:30
@artturin:matrix.orgArtturinIf it doesn't work then just override the stdenv on your end18:20:19
@suskeyhose:matrix.orgsrasuOk, looks like I got it working! It's really strange though that it always seems that it wants there to be a libBlocksRuntime.so that symlinks the BlocksRuntime.dll that the linker wants18:25:30
@suskeyhose:matrix.orgsrasu Thanks so much for your help Artturin ! You've gotten me set straight with a working build in a couple of hours when I've spent weeks trying to get it working before. 18:33:14
@artturin:matrix.orgArtturinYou're welcome18:36:26
@suskeyhose:matrix.orgsrasuRedacted or Malformed Event18:57:45
@suskeyhose:matrix.orgsrasuRedacted or Malformed Event20:06:04
@suskeyhose:matrix.orgsrasuRedacted or Malformed Event20:06:44
@artturin:matrix.orgArtturin

srasu: Maybe you can improve upstreams builds system?
This is what a usual output looks like for a autoconf library on mingw
speex

$ tree result
result
├── bin
│   └── libspeex-1.dll
└── lib
    ├── libspeex.dll.a
    └── libspeex.la
21:27:48
@artturin:matrix.orgArtturin

Or maybe simply substitute the .so in the build scripts with stdenv.hostPlatform.extensions.library

nix-repl> pkgsCross.mingwW64.libblocksruntime.stdenv.hostPlatform.extensions
{
  executable = ".exe";
  library = ".dll";
  sharedLibrary = ".dll";
  staticLibrary = ".lib";
}
21:30:35
@artturin:matrix.orgArtturin

windows.libgnurx

result
├── bin
│   └── libgnurx-0.dll
├── include
│   └── regex.h
├── lib
│   ├── libgnurx.dll.a
│   └── libregex.a
└── share
    └── man
        ├── man3
        │   └── regex.3.gz
        └── man7
            └── regex.7.gz
21:33:26
@artturin:matrix.orgArtturin

It's build log

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/wbiaws7m5skamns5n5kc1xx3c83lkzap-mingw-libgnurx-2.5.1-src.tar.gz
source root is mingw-libgnurx-2.5.1
setting SOURCE_DATE_EPOCH to timestamp 1178567546 of file mingw-libgnurx-2.5.1/configure
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
patching script interpreter paths in ./configure
./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/sh"
configure flags: --prefix=/nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1 --build=x86_64-unknown-linux-gnu --host=x86_64-w64-mingw32
checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-w64-mingw32-gcc accepts -g... yes
checking for x86_64-w64-mingw32-gcc option to accept ANSI C... none needed
checking whether x86_64-w64-mingw32-gcc accepts the -mthreads option... yes
checking whether x86_64-w64-mingw32-gcc accepts the -mtune=pentium3 option... no
checking for x86_64-w64-mingw32-lib... no
checking for lib... no
configure: creating ./config.status
config.status: creating Makefile
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: SHELL=/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash
x86_64-w64-mingw32-gcc -mthreads -g -O2 -I .   -c -o regex.o regex.c
In file included from regex.c:61:
regex_internal.h:424: warning: "alloca" redefined
  424 | # define alloca(size)   __builtin_alloca (size)
      | 
In file included from /nix/store/vchms9s5n98gp5fglxpvm5r3p9if4zf1-x86_64-w64-mingw32-gcc-13.3.0/x86_64-w64-mingw32/sys-include/stdlib.h:770,
                 from regex_internal.h:27:
/nix/store/vchms9s5n98gp5fglxpvm5r3p9if4zf1-x86_64-w64-mingw32-gcc-13.3.0/x86_64-w64-mingw32/sys-include/malloc.h:164: note: this is the location of the previous definition
  164 | #define alloca(x) __builtin_alloca((x))
      | 
In file included from regex.c:64:
regcomp.c: In function 'parse_dup_op':
regcomp.c:2513:39: warning: cast to pointer from integer of different size []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-to-pointer-cast-Wint-to-pointer-cast]8;;]
 2513 |     postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
      |                                       ^
regcomp.c: In function 'mark_opt_subexp':
regcomp.c:3725:19: warning: cast from pointer to integer of different size []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wpointer-to-int-cast-Wpointer-to-int-cast]8;;]
 3725 |   int idx = (int) (long) extra;
      |                   ^
x86_64-w64-mingw32-gcc -mthreads -g -O2 -I . -shared -o libgnurx-0.dll -Wl,--enable-auto-image-base -Wl,--out-implib,libgnurx.dll.a regex.o
cp -p libgnurx.dll.a libregex.a
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
install flags: SHELL=/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash install
mkdir -p /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin
cp -p libgnurx-0.dll /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin
mkdir -p /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/include /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/lib
cp -p ./regex.h /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/include
cp -p libgnurx.dll.a libregex.a  /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/lib
for s in 3 7; do \
  mkdir -p /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/man/man$s; \
  gzip -c ./regex.$s > /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/man/man$s/regex.$s.gz; \
done
Running phase: fixupPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
moving /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/man to /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/share/man
DLLPATH='/nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin:/nix/store/f46sb9xfa39dn9hvi7arwpzsgzbcsnvj-x86_64-w64-mingw32-gcc-13.3.0-lib/x86_64-w64-mingw32/lib:/nix/store/f46sb9xfa39dn9hvi7arwpzsgzbcsnvj-x86_64-w64-mingw32-gcc-13.3.0-lib/x86_64-w64-mingw32/lib64:/nix/store/xagf58ckdki9rwlxwpssgnqkpwskzk9x-mcfgthread-x86_64-w64-mingw32-1.6.1/lib:/nix/store/xagf58ckdki9rwlxwpssgnqkpwskzk9x-mcfgthread-x86_64-w64-mingw32-1.6.1/bin'
Created 0 DLL link(s) in /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin
shrinking RPATHs of ELF executables and libraries in /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1
checking for references to /build/ in /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1...
gzipping man pages under /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/share/man/
patching script interpreter paths in /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1
stripping (with command x86_64-w64-mingw32-strip and flags -S -p) in  /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/lib /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin
21:34:05
@artturin:matrix.orgArtturin *

It's build log

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/wbiaws7m5skamns5n5kc1xx3c83lkzap-mingw-libgnurx-2.5.1-src.tar.gz
source root is mingw-libgnurx-2.5.1
setting SOURCE_DATE_EPOCH to timestamp 1178567546 of file mingw-libgnurx-2.5.1/configure
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
patching script interpreter paths in ./configure
./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/sh"
configure flags: --prefix=/nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1 --build=x86_64-unknown-linux-gnu --host=x86_64-w64-mingw32
checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-w64-mingw32-gcc accepts -g... yes
checking for x86_64-w64-mingw32-gcc option to accept ANSI C... none needed
checking whether x86_64-w64-mingw32-gcc accepts the -mthreads option... yes
checking whether x86_64-w64-mingw32-gcc accepts the -mtune=pentium3 option... no
checking for x86_64-w64-mingw32-lib... no
checking for lib... no
configure: creating ./config.status
config.status: creating Makefile
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: SHELL=/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash
x86_64-w64-mingw32-gcc -mthreads -g -O2 -I .   -c -o regex.o regex.c
In file included from regex.c:61:
regex_internal.h:424: warning: "alloca" redefined
  424 | # define alloca(size)   __builtin_alloca (size)
      | 
In file included from /nix/store/vchms9s5n98gp5fglxpvm5r3p9if4zf1-x86_64-w64-mingw32-gcc-13.3.0/x86_64-w64-mingw32/sys-include/stdlib.h:770,
                 from regex_internal.h:27:
/nix/store/vchms9s5n98gp5fglxpvm5r3p9if4zf1-x86_64-w64-mingw32-gcc-13.3.0/x86_64-w64-mingw32/sys-include/malloc.h:164: note: this is the location of the previous definition
  164 | #define alloca(x) __builtin_alloca((x))
      | 
In file included from regex.c:64:
regcomp.c: In function 'parse_dup_op':
regcomp.c:2513:39: warning: cast to pointer from integer of different size []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-to-pointer-cast-Wint-to-pointer-cast]8;;]
 2513 |     postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
      |                                       ^
regcomp.c: In function 'mark_opt_subexp':
regcomp.c:3725:19: warning: cast from pointer to integer of different size []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wpointer-to-int-cast-Wpointer-to-int-cast]8;;]
 3725 |   int idx = (int) (long) extra;
      |                   ^
x86_64-w64-mingw32-gcc -mthreads -g -O2 -I . -shared -o libgnurx-0.dll -Wl,--enable-auto-image-base -Wl,--out-implib,libgnurx.dll.a regex.o
cp -p libgnurx.dll.a libregex.a
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
install flags: SHELL=/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash install
mkdir -p /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin
cp -p libgnurx-0.dll /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin
mkdir -p /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/include /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/lib
cp -p ./regex.h /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/include
cp -p libgnurx.dll.a libregex.a  /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/lib
for s in 3 7; do \
  mkdir -p /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/man/man$s; \
  gzip -c ./regex.$s > /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/man/man$s/regex.$s.gz; \
done
Running phase: fixupPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
moving /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/man to /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/share/man
DLLPATH='/nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin:/nix/store/f46sb9xfa39dn9hvi7arwpzsgzbcsnvj-x86_64-w64-mingw32-gcc-13.3.0-lib/x86_64-w64-mingw32/lib:/nix/store/f46sb9xfa39dn9hvi7arwpzsgzbcsnvj-x86_64-w64-mingw32-gcc-13.3.0-lib/x86_64-w64-mingw32/lib64:/nix/store/xagf58ckdki9rwlxwpssgnqkpwskzk9x-mcfgthread-x86_64-w64-mingw32-1.6.1/lib:/nix/store/xagf58ckdki9rwlxwpssgnqkpwskzk9x-mcfgthread-x86_64-w64-mingw32-1.6.1/bin'
Created 0 DLL link(s) in /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin
shrinking RPATHs of ELF executables and libraries in /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1
checking for references to /build/ in /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1...
gzipping man pages under /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/share/man/
patching script interpreter paths in /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1
stripping (with command x86_64-w64-mingw32-strip and flags -S -p) in  /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/lib /nix/store/84cpsbw62bddnjb9f9jd6zpp0r1qyh5h-libgnurx-x86_64-w64-mingw32-2.5.1/bin
21:34:11
7 Oct 2024
@memegames99:matrix.org@memegames99:matrix.org removed their profile picture.00:05:43

Show newer messages


Back to Room ListRoom Version: 6