php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63537 vs2012 link error
Submitted: 2012-11-16 08:10 UTC Modified: 2013-02-18 00:36 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (100.0%)
From: ajron at wp dot pl Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-11-16 08:10 UTC] ajron at wp dot pl
Description:
------------
Microsoft linker version information option has format:
/VERSION:major[.minor]

The major and minor arguments are decimal numbers in the range 0 through 65,535. 
The default is version 0.0.

Linker puts this version number in the PE header of the .EXE file or DLL. There 
is no room in the PE header to put more than 2 numbers. Linkers before vs2012 
skip extra numbers during linking, but vs2012 linker throws error.

The problem is in \win32\build\config.w32 file.

There is:

// General link flags
DEFINE("LDFLAGS", "/nologo /version:" +
	PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION); 

Should be:

// General link flags
DEFINE("LDFLAGS", "/nologo /version:" +
	PHP_VERSION + "." + PHP_MINOR_VERSION); 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-16 08:13 UTC] pajoye@php.net
As far I remember I fixed that in all branches, can you try master, 5.5 or latest 
53/4 please?
 [2012-11-16 08:13 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2012-11-16 08:33 UTC] ajron at wp dot pl
-Status: Feedback +Status: Open
 [2012-11-16 08:33 UTC] ajron at wp dot pl
This problem is in latest stable releases: 5.3.18 and 5.4.8
 [2012-11-16 08:50 UTC] pajoye@php.net
did you try using master?
 [2012-11-16 09:25 UTC] ajron at wp dot pl
What does "master" mean?

I've tried stable build 5.3.18, 5.4.8 and snapshots php5.3-201211160830, php5.4-
201211160830, php-trunk-201211160830.

I've added to win32\build\confutils.js new compiler:
VC_VERSIONS[1700] = 'MSVC11 (Visual C++ 2012)';
VC_VERSIONS_SHORT[1700] = 'VC11';

During compilation (without config.w32 patch), I have error:

LINK : fatal error LNK1117: syntax error in option 'version:5.3.20'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
11.0\VC\BIN\cl.exe"' : return code '0x2'
Stop.
 [2012-11-16 09:35 UTC] pajoye@php.net
Hm, not sure what happens but here is the commit:

http://git.php.net/?p=php-
src.git;a=commitdiff;h=dabe89c6f36a03117e1614546dd90de80b9e90d4

I have to check why it is not present anymore :)
 [2012-11-16 10:01 UTC] ajron at wp dot pl
Strange :)

I think, that "if (VCVERS >= 1700)" in your commit is unnecessary, because older 
versions also don't use PHP_MINOR_VERSION.

This version is written only to MajorImageVersion and MinorImageVersion of 
IMAGE_OPTIONAL_HEADER of PE file header by all ms linkers.


Below, there is the correct version for all compilers:

DEFINE("LDFLAGS", "/nologo /version:" + PHP_VERSION + "." + PHP_MINOR_VERSION);
 [2012-11-19 10:09 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2012-11-19 10:09 UTC] pajoye@php.net
We need the full version in three. So I have to check if we can use the string 
representation instead. Also this is a purely PHP definition, not VC (not sure 
how you interpret it :).

I also wonder why I do not get any linker error with the current branches. 
Everything builds just fine.
Also:

> I've added to win32\build\confutils.js new compiler:
> VC_VERSIONS[1700] = 'MSVC11 (Visual C++ 2012)';
> VC_VERSIONS_SHORT[1700] = 'VC11';

is already committed, it should not be necessary to add them again. Maybe try 
using a newer snapshot? http://windows.php.net/downloads/snaps/master/


Dziękuję za informacje :)
 [2013-02-18 00:36 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 20:01:29 2024 UTC