Commit: Fix building gold with gcc 10

Message ID 87mueudpu9.fsf@redhat.com
State New
Headers show
Series
  • Commit: Fix building gold with gcc 10
Related show

Commit Message

Nick Clifton Sept. 24, 2019, 9:07 a.m.
Hi Guys,

  I have just been alerted to the fact that gold will not build with
  gcc 10 due to a header file problem:
  
> BUILDSTDERR: In file included from debug.h:29,

> BUILDSTDERR:                  from workqueue-threads.cc:33:

> BUILDSTDERR: errors.h:87:50: error: 'string' in namespace 'std' does not name a type

> BUILDSTDERR:    87 |   undefined_symbol(const Symbol* sym, const std::string& location);

> BUILDSTDERR:       |                                                  ^~~~~~

> BUILDSTDERR: errors.h:29:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?


  So I am checking in the obvious patch to fix the problem.  (To the
  mainline and 2.33 branch).

Cheers
  Nick

gold/ChangeLog
2019-09-24  Nick Clifton  <nickc@redhat.com>

	* descriptors.cc: Include <string>

Comments

Cary Coutant Sept. 24, 2019, 11:11 p.m. | #1
> gold/ChangeLog

> 2019-09-24  Nick Clifton  <nickc@redhat.com>

>

>         * descriptors.cc: Include <string>


Thanks, Nick!

-cary

Patch

diff --git a/gold/descriptors.cc b/gold/descriptors.cc
index 92fd42f41f..d5cc9fc4c9 100644
--- a/gold/descriptors.cc
+++ b/gold/descriptors.cc
@@ -26,6 +26,7 @@ 
 #include <cstdio>
 #include <cstring>
 #include <fcntl.h>
+#include <string>
 #include <unistd.h>
 
 #include "debug.h"