Bug 30119 - error: static assertion failed due to requirement
Summary: error: static assertion failed due to requirement
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Cary Coutant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-13 11:57 UTC by Arshia Aghaei
Modified: 2023-02-13 11:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arshia Aghaei 2023-02-13 11:57:28 UTC
Hi, following the guide in https://llvm.org/docs/GoldPlugin.html

My OS is Arch-Linux 64-bit

I get the following errors:

```cpp
In file included from ../../gold/stringpool.cc:23:
In file included from ../../gold/gold.h:35:
In file included from ../../gold/system.h:68:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/unordered_set:46:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable.h:35:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable_policy.h:1697:4: error: static assertion failed due to requirement 'std::__is_invocable<const gold::Stringpool_template<char>::Stringpool_eq &, const gold::Stringpool_template<char>::Hashkey &, const gold::Stringpool_template<char>::Hashkey &>{}': key equality predicate must be invocable with two arguments of key type
          static_assert(
```

```cpp
In file included from ../../gold/stringpool.cc:23:
In file included from ../../gold/gold.h:35:
In file included from ../../gold/system.h:68:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/unordered_set:46:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable.h:35:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable_policy.h:1697:4: error: static assertion failed due to requirement 'std::__is_invocable<const gold::Stringpool_template<unsigned int>::Stringpool_eq &, const gold::Stringpool_template<unsigned int>::Hashkey &, const gold::Stringpool_template<unsigned int>::Hashkey &>{}': key equality predicate must be invocable with two arguments of key type
          static_assert(
```



```cpp
In file included from ../../gold/stringpool.cc:23:
In file included from ../../gold/gold.h:35:
In file included from ../../gold/system.h:68:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/unordered_set:46:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable.h:35:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable_policy.h:1685:2: error: static assertion failed due to requirement 'std::__is_invocable<const gold::Stringpool_template<char>::Stringpool_eq &, const gold::Stringpool_template<char>::Hashkey &, const gold::Stringpool_template<char>::Hashkey &>{}': key equality predicate must be invocable with two arguments of key type
        static_assert(__is_invocable<const _Equal&, const _Key&, const _Key&>{},
```



```cpp
In file included from ../../gold/stringpool.cc:23:
In file included from ../../gold/gold.h:35:
In file included from ../../gold/system.h:68:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/unordered_set:46:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable.h:35:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable_policy.h:1697:4: error: static assertion failed due to requirement 'std::__is_invocable<const gold::Stringpool_template<unsigned short>::Stringpool_eq &, const gold::Stringpool_template<unsigned short>::Hashkey &, const gold::Stringpool_template<unsigned short>::Hashkey &>{}': key equality predicate must be invocable with two arguments of key type
          static_assert(
```

```cpp
In file included from ../../gold/stringpool.cc:23:
In file included from ../../gold/gold.h:35:
In file included from ../../gold/system.h:68:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/unordered_set:46:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable.h:35:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable_policy.h:1685:2: error: static assertion failed due to requirement 'std::__is_invocable<const gold::Stringpool_template<unsigned short>::Stringpool_eq &, const gold::Stringpool_template<unsigned short>::Hashkey &, const gold::Stringpool_template<unsigned short>::Hashkey &>{}': key equality predicate must be invocable with two arguments of key type
        static_assert(__is_invocable<const _Equal&, const _Key&, const _Key&>{},
```

```cpp
In file included from ../../gold/stringpool.cc:23:
In file included from ../../gold/gold.h:35:
In file included from ../../gold/system.h:68:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/unordered_set:46:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable.h:35:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable_policy.h:1697:4: error: static assertion failed due to requirement 'std::__is_invocable<const gold::Stringpool_template<unsigned int>::Stringpool_eq &, const gold::Stringpool_template<unsigned int>::Hashkey &, const gold::Stringpool_template<unsigned int>::Hashkey &>{}': key equality predicate must be invocable with two arguments of key type
          static_assert(
```


```cpp

In file included from ../../gold/stringpool.cc:23:
In file included from ../../gold/gold.h:35:
In file included from ../../gold/system.h:68:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/unordered_set:46:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable.h:35:
/usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/bits/hashtable_policy.h:1685:2: error: static assertion failed due to requirement 'std::__is_invocable<const gold::Stringpool_template<unsigned int>::Stringpool_eq &, const gold::Stringpool_template<unsigned int>::Hashkey &, const gold::Stringpool_template<unsigned int>::Hashkey &>{}': key equality predicate must be invocable with two arguments of key type
        static_assert(__is_invocable<const _Equal&, const _Key&, const _Key&>{},
```

Final summary:

```cpp

6 errors generated.
make[3]: *** [Makefile:1144: stringpool.o] Error 1
make[3]: Leaving directory '/home/arshia/Desktop/llvm-project/llvm-gold/build/gold'
make[2]: *** [Makefile:1167: all-recursive] Error 1
make[2]: Leaving directory '/home/arshia/Desktop/llvm-project/llvm-gold/build/gold'
make[1]: *** [Makefile:907: all] Error 2
make[1]: Leaving directory '/home/arshia/Desktop/llvm-project/llvm-gold/build/gold'
make: *** [Makefile:6887: all-gold] Error 2
```