NQP dyncall library doesn't build under Strawberry Perl #47

Closed
pmichaud opened this Issue Jul 11, 2012 · 8 comments

5 participants

@pmichaud
Perl 6 member

I tried on several machines to build/install Rakudo under WIndows, and NQP consistently fails for me when attempting to create the dyncall ops.

Under Windows XP 32-bit and Strawberry Perl 5.16.0, I get this error:

cd src\ops && g++ -o nqp_dyncall_ops.dll nqp_dyncall_ops.o ..\6model\reprs\NativeCall.o 
..\6model\reprs\CStruct.o ..\6model\reprs\CPointer.o ..\6model\reprs\CArray.o ..\6model\reprs\CStr.o
..\..\3rdparty\dyncall\dyncall\libdyncall_s.a ..\.. \3rdparty\dyncall\dyncallback\libdyncallback_s.a 
..\..\3rdparty\dyncall\dynload\libdynload_s.a  -shared  "C:\rakudo\install\bin\libparrot.dll" -lmoldname -lkernel32 
 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 
 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lgmp
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x2bd): undefined reference to `dcCall_x86_win32_fast'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x2fd): undefined reference to `dcCall_x86_sys_int80h_bsd'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x32d): undefined reference to `dcCall_x86_sys_int80h_linux'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x35d): undefined reference to `dcCall_x86_win32_msthis'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x38d): undefined reference to `dcCall_x86_win32_std'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x3bd): undefined reference to `dcCall_x86_cdecl'
 c:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw
 32/bin/ld.exe: ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):
 bad reloc address 0x0 in section `.data'
 collect2: ld returned 1 exit status
 gmake: *** [src\ops\nqp_dyncall_ops.dll] Error 1

I downgraded to Strawberry Perl 5.12.3 (since diakopter++ reported being able to build with it), and I get:

 cd src\ops && g++ -o nqp_dyncall_ops.dll nqp_dyncall_ops.o ..\6model\reprs\Nativ
 eCall.o ..\6model\reprs\CStruct.o ..\6model\reprs\CPointer.o ..\6model\reprs\CAr
 ray.o ..\6model\reprs\CStr.o ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a ..\..
 \3rdparty\dyncall\dyncallback\libdyncallback_s.a ..\..\3rdparty\dyncall\dynload\
 libdynload_s.a  -shared  "C:\rakudo\install\bin\libparrot.dll" -lmoldname -lkern
 el32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleau
 t32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcom
 ctl32 -lgmp
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x2bd): undefined reference to `dcCall_x86_win32_fast'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x2fd): undefined reference to `dcCall_x86_sys_int80h_bsd'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x32d): undefined reference to `dcCall_x86_sys_int80h_linux'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x35d): undefined reference to `dcCall_x86_win32_msthis'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x38d): undefined reference to `dcCall_x86_win32_std'
 ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
 :(.text+0x3bd): undefined reference to `dcCall_x86_cdecl'
 collect2: ld returned 1 exit status
 gmake: *** [src\ops\nqp_dyncall_ops.dll] Error 1
 Command failed (status 512): gmake
 Command failed (status 512): C:\strawberry\perl\bin\perl.exe Configure.pl --with
 -parrot=C:/rakudo/install/bin/parrot.exe --make-install

Thinking the problem might be 32-bit windows versus 64-bit windows, I then tried
on a 64-bit WIndows 7 machine (Strawberry 5.12.3) and I get a somewhat different error:

cd src\ops && g++ -o nqp_dyncall_ops.dll nqp_dyncall_ops.o ..\6model\reprs\Nativ
eCall.o ..\6model\reprs\CStruct.o ..\6model\reprs\CPointer.o ..\6model\reprs\CAr
ray.o ..\6model\reprs\CStr.o ..\..\3rdparty\dyncall\dyncall\libdyncall_s.a ..\..
\3rdparty\dyncall\dyncallback\libdyncallback_s.a ..\..\3rdparty\dyncall\dynload\
libdynload_s.a  -shared  "C:\rakudo\install\bin\libparrot.dll" -lmoldname -lkern
el32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleau
t32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcom
ctl32 -lgmp
..\..\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o):dyncall_callvm.c
:(.text+0x28b): undefined reference to `dcCall_x64_win64'
collect2: ld returned 1 exit status
gmake: *** [src\ops\nqp_dyncall_ops.dll] Error 1
Command failed (status 512): gmake
Command failed (status 512): C:\strawberry\perl\bin\perl.exe Configure.pl --with
-parrot=C:/rakudo/install/bin/parrot.exe --make-install

I'm not sure what to look at next, but will be glad to give various commands a try.

Thanks!

@pmichaud
Perl 6 member

Update: On one of my other systems running Win XP 32-bit, I was able to get NQP (and Rakudo) to compile successfully using Strawberry Perl 5.12.3. I then went back to my original system, made sure everything was clean, and tried building with Strawberry Perl 5.12.3, and it worked also.

So, for Win XP 32-bit, it appears that everything compiles okay if Strawberry Perl 5.12.3 is used. I'm guessing that I didn't clean everything properly in my earlier test when I downgraded from 5.16.0 to 5.12.3.

Also to verify, I reinstalled 5.16.0 on the original machine and got the same failure reported above, then downgraded again to 5.12.3 (making sure to git clean -xdf the appropriate repos) and everything worked fine.

So the problem appears to be getting nqp to build on 32-bit Strawberry Perl 5.16.0. I also tried 5.14.2 and got a similar fail.

The Windows 7 64-bit machine was running 64-bit Strawberry 5.12.3, though (never had any other version installed), so there appears to be an issue there also. If I can get some time on that machine again I may try with a later version of Strawberry Perl.

Bottom line: nqp's dyncall library works on 32-bit Strawberry 5.12.3, but fails with 5.14.2 and 5.16.0. The one 64-bit machine I tested failed for 64-bit Strawberry 5.12.3.

Pm

@diakopter
Perl 6 member

My experiences on Windows 7 exactly match pmichaud's:

diakopter: 64-bit Windows7, 32-bit strawberry 5.12.3.0; 32-bit cmd.exe; SUCCESS
diakopter: 64-bit Windows7, 64-bit strawberry 5.16.0.1; 32-bit cmd.exe; undefined reference to 'dcCall_x64_win64'
diakopter: 64-bit Windows7, 32-bit strawberry 5.16.0.1; 32-bit cmd.exe; ....\3rdparty\dyncall\dyncall\libdyncall_s.a(dyncall_callvm.o): bad reloc address 0x0 in section '.data'

@zhuomingliang
Perl 6 member

I found that why built dyncall failed between different strawberry perl versions, try "cd nqp\3rdparty\dyncall\dyncall && as -o dyncall_call.o dyncall_call.S", you will see an emtpy dyncall_call.o file in higher strawberry perl version.

This error aslo occured in dyncall 0.6, then I updated it to 0.7.

@zhuomingliang
Perl 6 member

I think we can report it to the dyncall team too. Maybe they have a good solution.

@gerdr

If I remember correctly, this is the same failure I saw when dealing with unknown Cygwin versions (see 6fb60c8). The Strawberry build probably uses configure.bat instead of configure, which doesn't do any OS detection, so I'm not sure why the problem occurs.

Could someone please paste dyncall's ConfigVars of a failed build? Also, the problem might be fixed in dyncall's trunk - the Cygwin one was.

edit: Turns out I misremember - what I was thinking of was the discussion starting here and ending here. We already tracked the problem to dyncall_call.S not including anything due to configuration issues, so pasting ConfigVars is still a good idea.

More relevant is the output of

gcc -dM -E nqp\3rdparty\dyncall\dyncall\dyncall_macros.h | findstr DC__

using Strawberry's gcc, though.

@pmichaud
Perl 6 member

After commit 62b9fc9, NQP builds for me with all of strawberry 5.12.3, 5.14.2, and 5.16.0 on my 32-bit WinXP system.

Reportedly it now fails for Strawberry 5.10, however.

If there's another patch that will enable NQP to build on 5.10 without destroying the ability to build on 5.12+, I'm okay with that. If the only way to get 5.10 to work is by breaking things for 5.14+, then I think we'll just bump our "minimum Strawberry" requirement to 5.12.

Pm

@gerdr

Next try for a fix: pull request #48

@arnsholt
Perl 6 member

Closing this, since we've merged #48.

@arnsholt arnsholt closed this Oct 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment