aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCostas Argyris <costas.argyris@gmail.com>2023-04-12 08:48:18 +0100
committerJonathan Yong <10walls@gmail.com>2023-04-12 14:35:33 +0000
commit3beeebd6934654f3453209730b98c7a1fd0305b6 (patch)
treeee01b276eba9f13284d1880794371e7ba6cca8c1
parent56529056cb42baa382c40de7d239d02dbf72c94f (diff)
downloadgcc-3beeebd6934654f3453209730b98c7a1fd0305b6.zip
gcc-3beeebd6934654f3453209730b98c7a1fd0305b6.tar.gz
gcc-3beeebd6934654f3453209730b98c7a1fd0305b6.tar.bz2
mingw: Support building with older gcc versions
The $@ argument to the compiler is causing only a warning in some gcc versions but an error in others. In any case, $@ was never necessary so remove it completely, just like the rules in x-mingw32 where the object file gets named after the source file. This fixes both warnings and errors about sym-mingw32.o appearing in the command line unnecessarily. The -nostdlib flag is required along with -r for older gcc versions that don't apply it automatically with -r, resulting in main functions erroneously entering a partial link. Signed-off-by: Jonathan Yong <10walls@gmail.com> gcc/ChangeLog: * config/i386/x-mingw32-utf8: Remove extrataneous $@
-rw-r--r--gcc/config/i386/x-mingw32-utf86
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/config/i386/x-mingw32-utf8 b/gcc/config/i386/x-mingw32-utf8
index 2783dd2..b5a6cfc 100644
--- a/gcc/config/i386/x-mingw32-utf8
+++ b/gcc/config/i386/x-mingw32-utf8
@@ -34,7 +34,7 @@ utf8rc-mingw32.o : $(srcdir)/config/i386/utf8-mingw32.rc \
# Create an object file that just exports the global symbol
# HOST_EXTRA_OBJS_SYMBOL
sym-mingw32.o : $(srcdir)/config/i386/sym-mingw32.cc
- $(COMPILER) -c $< $@
+ $(COMPILER) -c $<
# Combine the two object files into one which has both the
# compiled utf8 resource and the HOST_EXTRA_OBJS_SYMBOL symbol.
@@ -44,8 +44,10 @@ sym-mingw32.o : $(srcdir)/config/i386/sym-mingw32.cc
# If nothing references it into libbackend.a, it will not
# get linked into the compiler proper eventually.
# Therefore we need to request the symbol at compiler link time.
+# -nostdlib is required for supporting old gcc versions that
+# don't apply it automatically with -r.
utf8-mingw32.o : utf8rc-mingw32.o sym-mingw32.o
- $(COMPILER) -r utf8rc-mingw32.o sym-mingw32.o -o $@
+ $(COMPILER) -r -nostdlib utf8rc-mingw32.o sym-mingw32.o -o $@
# Force compilers to link against the utf8 resource by
# requiring the symbol to be defined.