develooper Front page | perl.perl5.porters | Postings from May 2015

Re: FILE structure internals issue building blead on WindowswithVisual Studio 2015 RC

Thread Previous | Thread Next
From:
A. Sinan Unur
Date:
May 4, 2015 15:30
Subject:
Re: FILE structure internals issue building blead on WindowswithVisual Studio 2015 RC
Message ID:
CABbccAN5t159Tp6LgRmx3mqqF8jjntbp5MrDZhX13WxkdjA8vw@mail.gmail.com
Yes, I have already been working through the other problems.

I actually solved the linking issue by removing the `-nodefaultlib` option.

As for the problem in sv.c, removing the leading + sign from a certain
field fixes the issue. I do not know if the + sign is needed for other
environments. For example:

diff --git a/sv.c b/sv.c
index 2bb0346..ab8a74c 100644
--- a/sv.c
+++ b/sv.c
@@ -980,25 +980,24 @@ static const struct body_details bodies_by_type[] = {

     { sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur),
       copy_length(XPV, xpv_len) - STRUCT_OFFSET(XPV, xpv_cur),
-      + STRUCT_OFFSET(XPV, xpv_cur),
+      STRUCT_OFFSET(XPV, xpv_cur),
       SVt_PV, FALSE, NONV, HASARENA,
       FIT_ARENA(0, sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur)) },

etc etc.

I have been trying to complete a build, and I was going address each
of these separately once I got to that point. I think the make file
and config_H.vc need some updating, but I am in the process of working
through all of that.

With the _iobuf problem, I did not even know how to make any progress
from that point. Anything I should try to look at, dig into?

Thanks,

-- Sinan


On Mon, May 4, 2015 at 11:14 AM, bulk88 <bulk88@hotmail.com> wrote:
> A. Sinan Unur wrote:
>>
>> On Sun, May 3, 2015 at 10:10 PM, bulk 88 <bulk88@hotmail.com> wrote:
>>>
>>> ----------------------------------------
>>>>
>>>> Date: Sat, 2 May 2015 20:54:19 -0400
>>>> Subject: FILE structure internals issue building blead on Windows with
>>>> Visual Studio 2015 RC
>>>> From: nanis@cpan.org
>>>> To: perl5-porters@perl.org
>>>>
>>>> I have been trying to build blead with Visual Studio 2015 RC. I have
>>>> been able to deal with a few minor issues, but I hit one where I am
>>>> not sure about the right way to proceed. I haven't opened an issue on
>>>> RT yet ... This message is an attempt to collect some information so
>>>> as to be able to compose a useful report.
>>>>
>>>> The build stops fails with the following errors:
>>>>
>>>> ..\perlio.c(3206): error C2039: '_file': is not a member of '_iobuf'
>>>> C:\Program Files (x86)\Windows
>>>> Kits\10\include\10.0.10056.0\ucrt\corecrt_wstdio.h(26): note: see
>>>> declaration of '_iobuf'
>>
>>
>> <snip>
>>
>>> please supply the perlio.i as in "nmake perlio.i"
>>
>>
>> Unfortunately, `nmake perlio.i` results in:
>>
>> NMAKE : fatal error U1073: don't know how to make 'perlio.i'
>> Stop.
>>
>
>
> egh, "nmake ../perlio.i" would generate it. I should have remembered that.
>
>> Assuming you want the pre-processed output from perlio.c, I ran:
>>
>> D:\Src\perl\win32> cl -P -nologo -GF -W3 -I..\lib\CORE -I.\include -I.
>> -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DWIN64 -DCONSERVATIVE
>> -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERLDLL
>> -DPERL_CORE   -O1 -Os -MT -Zi -DNDEBUG -GL -fp:precise -favor:INTEL64
>> -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL ..\perlio.c
>>
>> which is based on the compilation command used by the make file.
>>
>> The output file was about 2MB, about 180K compressed, so I decided
>> against attaching it. You can download it from:
>>
>> http://www.nu42.com/tmp/perlio.i.bz2
>>
>> If you'd rather I email to you privately, please let me know.
>>
>> Thank you,
>>
>> -- Sinan
>
>
> I dont see your perlio.c problem with my VC 2015 RC compiler. I do see a
> whole pile of other problems.
>
> First problem, MS split "msvcrt.lib" into 3 different files per
> http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx
> . That shows itself as being impossible to link anything
>
> C:\p521\src\win32>nmake test
>
> Microsoft (R) Program Maintenance Utility Version 14.00.22816.0
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
>         link -subsystem:console -out:..\generate_uudmap.exe -nologo
> -nodefaultlib -debug -opt:ref,icf -ltcg  -libpath:"c:\p521\lib\CORE"
> -machine:x86 "/manifestdependency:type='Win32'
> name='Microsoft.Windows.Common-Controls' version='6.0.0.0'
> processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
> oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib
> advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib
> ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
> comctl32.lib msvcrt.lib ..\generate_uudmap.obj
> generate_uudmap.obj : error LNK2001: unresolved external symbol
> __imp__strerror
> generate_uudmap.obj : error LNK2001: unresolved external symbol __imp__fopen
> generate_uudmap.obj : error LNK2001: unresolved external symbol
> __imp____stdio_c
> ommon_vfprintf
> generate_uudmap.obj : error LNK2001: unresolved external symbol __imp__exit
> generate_uudmap.obj : error LNK2001: unresolved external symbol __imp__fputs
> generate_uudmap.obj : error LNK2001: unresolved external symbol
> __imp___errno
> generate_uudmap.obj : error LNK2001: unresolved external symbol
> __imp__fclose
> generate_uudmap.obj : error LNK2001: unresolved external symbol __imp__fputc
> generate_uudmap.obj : error LNK2001: unresolved external symbol
> __imp____acrt_iob_func
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __seh_filter_exe
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __set_app_type
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> ___setusermatherr
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __configure_narrow_argv
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __initialize_narrow_environment
> msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol
> __initialize_narrow_environment
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __get_initial_narrow_environment
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __initterm
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __initterm_e
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _exit
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol __exit
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __set_fmode
>
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> ___p___argc
>
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> ___p___argv
>
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol __cexit
> msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol __cexit
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __c_exit
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __register_thread_local_exe_atexit_callback
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> ___telemetry_main_invoke_trigger
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> ___telemetry_main_return_trigger
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __configthreadlocale
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> __set_new_mode
> msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol
> ___p__commode
> msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol
> __seh_filter_dll
> msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol
> __initialize_onexit_table
> msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol
> __register_onexit_function
> msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol
> __execute_onexit_table
> msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol
> __crt_atexit
> msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol
> __crt_at_quick_exit
> msvcrt.lib(tncleanup.obj) : error LNK2001: unresolved external symbol
> ___std_type_info_destroy_list
> msvcrt.lib(default_precision.obj) : error LNK2001: unresolved external
> symbol __controlfp_s
> msvcrt.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol
> _terminate
> msvcrt.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol
> _memset
> msvcrt.lib(_chandler4gs_.obj) : error LNK2001: unresolved external symbol
> __except_handler4_common
> ..\generate_uudmap.exe : fatal error LNK1120: 41 unresolved externals
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> 14.0\VC\BI
> N\link.EXE"' : return code '0x460'
> Stop.
>
> C:\p521\src\win32>
>
>
> After hacking the nmake makefile with "LIBC             = msvcrt.lib
> vcruntime.lib ucrt.lib" I can't compile sv.c.
>
> C:\p521\src\win32>nmake mini/sv.obj
>
> Microsoft (R) Program Maintenance Utility Version 14.00.22816.0
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
>         cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32
> -D_CONS
> OLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
> -DPERLDLL
>  -DPERL_CORE   -O1 -MD -Zi -DNDEBUG -GS- -DPERL_EXTERNAL_GLOB
> -DPERL_IS_MINIPERL
>  -Fo.\mini\sv.obj ..\sv.c
> sv.c
> C:\Program Files\Microsoft Visual Studio 14.0\VC\INCLUDE\stdbool.h(15):
> warning
> C4005: 'bool': macro redefinition
> c:\p521\src\handy.h(103): note: see previous definition of 'bool'
> ..\sv.c(989): error C2099: initializer is not a constant
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> 14.0\VC\BI
> N\cl.EXE"' : return code '0x2'
> Stop.
>
> C:\p521\src\win32>
>
>
> The line number above doesn't match blead, but it is the last line of
> "static const struct body_details bodies_by_type[]" array.
>
> Deleting the elements of that array one by one, shows that atleast this
> initializer is causing the "not a constant" error. I am not sure if the
> later SV type slices are also causing "not a constant" but I can't compile
> sv.c until I cut back to SVt_PV.
>
>
>     { sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur),
>       copy_length(XPV, xpv_len) - STRUCT_OFFSET(XPV, xpv_cur),
>       + STRUCT_OFFSET(XPV, xpv_cur),
>       SVt_PV, FALSE, NONV, HASARENA,
>       FIT_ARENA(0, sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur)) },
>
> a .i output shows
>
> -------------------------------------------------------------------
> static const struct body_details bodies_by_type[] = {
>
>     { 0, 0, 0, SVt_NULL, (0), (1), (0), 0 },
>
>
>     { 0,
>       sizeof(IV),
>       (size_t)(&(((XPVIV *)0)->xiv_u.xivu_iv)), SVt_IV, (0), (1),
>       (0) , 0
>     },
>
>
>
>
>
> #line 976 "../sv.c"
>     { sizeof(NV), sizeof(NV),
>       (size_t)(&(((XPVNV *)0)->xnv_u)),
>       SVt_NV, (0), (0), (1), (U32)(0 ? ( 0 * sizeof(NV) <= 4080) ? 0 *
> sizeof(NV) : ((size_t)(4080 / sizeof(NV)) * sizeof(NV)) : ((size_t)(4080 /
> sizeof(NV)) * sizeof(NV))) },
> #line 980 "../sv.c"
>
>     { sizeof(XPV) - (size_t)(&(((XPV *)0)->xpv_cur)),
>       (size_t)(&(((XPV *)0)->xpv_len_u.xpvlenu_len)) + sizeof
> (((XPV*)((const SV *)0)->sv_any)->xpv_len_u.xpvlenu_len) - (size_t)(&(((XPV
> *)0)->xpv_cur)),
>       + (size_t)(&(((XPV *)0)->xpv_cur)),
>       SVt_PV, (0), (1), (1),
>       (U32)(0 ? ( 0 * sizeof(XPV) - (size_t)(&(((XPV *)0)->xpv_cur)) <=
> 4080) ? 0 * sizeof(XPV) - (size_t)(&(((XPV *)0)->xpv_cur)) : ((size_t)(4080
> / sizeof(XPV) - (size_t)(&(((XPV *)0)->xpv_cur))) * sizeof(XPV) -
> (size_t)(&(((XPV *)0)->xpv_cur))) : ((size_t)(4080 / sizeof(XPV) -
> (size_t)(&(((XPV *)0)->xpv_cur))) * sizeof(XPV) - (size_t)(&(((XPV
> *)0)->xpv_cur)))) },
>
>
>
> };
> -------------------------------------------------------------------
>
> I dont have time to file bug tickets with MS about this.
>
>
> The CC I am using is
> -------------------------------------------------------------------
> C:\p521\src\win32>cl
> Microsoft (R) C/C++ Optimizing Compiler Version 19.00.22816 for x86
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> usage: cl [ option... ] filename... [ /link linkoption... ]
>
> C:\p521\src\win32>
> -------------------------------------------------------------------

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About