Skip to content

Commit 46d6baf

Browse files
committed
fix linking for clang, using linker directly
1 parent 936575c commit 46d6baf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

win32/build/config.w32

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ if (VS_TOOLSET && VCVERS >= 1500 && PHP_MP != 'disable') {
233233

234234
// General link flags
235235

236-
if (VS_TOOLSET) {
237-
if (VCVERS >= 1700) {
236+
if (VS_TOOLSET || CLANG_TOOLSET) {
237+
if (VCVERS >= 1700 || CLANG_TOOLSET) {
238238
DEFINE("LDFLAGS", "/nologo ");
239239
} else {
240240
DEFINE("LDFLAGS", "/nologo /version:" +

win32/build/confutils.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,15 +1117,15 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
11171117
if (ld) {
11181118
MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
11191119
} else {
1120-
ld = "@$(CC)";
1121-
MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
1120+
ld = '@"$(LINK)"';
1121+
MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
11221122
}
11231123
} else {
11241124
if (ld) {
11251125
MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
11261126
} else {
1127-
ld = "@$(CC)";
1128-
MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
1127+
ld = '@"$(LINK)"';
1128+
MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
11291129
}
11301130
}
11311131

@@ -1290,7 +1290,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
12901290
var libname = dllname.substring(0, dllname.length-4) + ".lib";
12911291

12921292
var resname = generate_version_info_resource(dllname, extname, configure_module_dirname, false);
1293-
var ld = "@$(CC)";
1293+
var ld = '@"$(LINK)"';
12941294

12951295
ldflags = "";
12961296
if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
@@ -1311,10 +1311,10 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
13111311
MFO.WriteBlankLines(1);
13121312
if (MODE_PHPIZE) {
13131313
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
1314-
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
1314+
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
13151315
} else {
13161316
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
1317-
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
1317+
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
13181318
}
13191319
MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)");
13201320
MFO.WriteBlankLines(1);

0 commit comments

Comments
 (0)