Browse Source

Fix build for gcc version 10

gcc 10 defaults to `-fno-common`, which results in a lot of "multiple
definition" errors when linking. As suggested by the gcc documentation,
we workaround the issue for now by setting the `-fcommon` flag:
https://gcc.gnu.org/gcc-10/porting_to.html#common

Signed-off-by: Fazlul Shahriar <fshahriar@gmail.com>
Fazlul Shahriar 3 years ago
parent
commit
c88a3dfa7a
2 changed files with 2 additions and 0 deletions
  1. 1 0
      amd64/gcc.json
  2. 1 0
      sys/src/9/amd64/gcc.json

+ 1 - 0
amd64/gcc.json

@@ -2,6 +2,7 @@
 	{
 		"Name": "buildflags",
 		"Cflags": [
+			"-fcommon",
 			"-fno-pie",
 			"-fvar-tracking",
 			"-fvar-tracking-assignments"

+ 1 - 0
sys/src/9/amd64/gcc.json

@@ -2,6 +2,7 @@
 	{
 		"Name": "buildflags",
 		"Cflags": [
+			"-fcommon",
 			"-fno-pie",
 			"-fvar-tracking",
 			"-fvar-tracking-assignments"