com php-src: generate response files for use by linker: win32/build/Makefile win32/build/confutils.js

From: Date: Wed, 12 Nov 2014 16:57:17 +0000
Subject: com php-src: generate response files for use by linker: win32/build/Makefile win32/build/confutils.js
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-83064@lists.php.net to get a copy of this message
Commit: 1acbcdeb27abefa1a6966a8d791fa2707931b79f Author: Anatol Belski <ab@php.net> Wed, 12 Nov 2014 17:05:01 +0100 Parents: 79c61c71c2a75e8fd41e5994f3ee774070d02bdd Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1acbcdeb27abefa1a6966a8d791fa2707931b79f Log: generate response files for use by linker Object dir path can under circumstances cause that the expanded command line exceeds the length allowed by the OS. Linker can read the object lists from a file which eliminates this issue. Changed paths: M win32/build/Makefile M win32/build/confutils.js Diff: diff --git a/win32/build/Makefile b/win32/build/Makefile index d6a22c1..c24bd70 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -90,7 +90,7 @@ $(PHPDLL_RES): win32\build\template.rc $(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE) # @$(CC) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /link /out:$(BUILD_DIR)\$(PHPDLL) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) - @"$(LINK)" $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) + @"$(LINK)" $(PHP_GLOBAL_OBJS_RESP) $(STATIC_EXT_OBJS_RESP) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) -@$(_VC_MANIFEST_EMBED_DLL) $(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 94068bf..201c368 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1336,6 +1336,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')'); } else { ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)"); + ADD_FLAG("STATIC_EXT_OBJS_RESP", "$(" + EXT + "_GLOBAL_OBJS_RESP)"); ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")"); ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")"); ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")"); @@ -1394,9 +1395,20 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) sym = target.toUpperCase() + "_GLOBAL_OBJS"; flags = "CFLAGS_" + target.toUpperCase() + '_OBJ'; + var bd = get_define('BUILD_DIR'); + var respd = bd + '\\resp'; + if (!FSO.FolderExists(respd)) { + FSO.CreateFolder(respd); + } + var obj_lst_fn = respd + '\\' + sym + '.txt'; + var resp = ""; + if (configure_subst.Exists(sym)) { tv = configure_subst.Item(sym); } else { + if (FSO.FileExists(obj_lst_fn)) { + FSO.DeleteFile(obj_lst_fn, true); + } tv = ""; } @@ -1448,6 +1460,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) src = file_list[i]; obj = src.replace(re, ".obj"); tv += " " + sub_build + obj; + resp += " " + sub_build.replace('$(BUILD_DIR)', bd) + obj; if (!PHP_MP_DISABLED) { if (i > 0) { @@ -1474,6 +1487,21 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) } DEFINE(sym, tv); + + /* Generate the response file and define it to the Makefile. This can be + useful when getting the "command line too long" linker errors. */ + var obj_lst_fh = null; + if (!FSO.FileExists(obj_lst_fn)) { + obj_lst_fh = FSO.CreateTextFile(obj_lst_fn); + //STDOUT.WriteLine("Creating " + obj_lst_fn); + } else { + //STDOUT.WriteLine("Appending to " + obj_lst_fn); + obj_lst_fh = FSO..OpenTextFile(obj_lst_fn, 8); + } + + obj_lst_fh.Write(" " + resp); + obj_lst_fh.Close(); + DEFINE(sym + "_RESP", '@"' + obj_lst_fn + '"'); } function REMOVE_TARGET(dllname, flag)

« previous php.cvs (#83064) next »