<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124957>124957</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc][hdrgen] macro_name/macro_value duplicates defines from libc/include/llvm-libc-macros/*-macros.h
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nickdesaulniers
</td>
</tr>
</table>
<pre>
I just noticed that our generated dlfcn.h has:
```c
#include "llvm-libc-macros/dlfcn-macros.h"
#define RTLD_LAZY
```
and my editor was warning me about `RTLD_LAZY` (and friends being redefined). I noticed because building llvm against our headers was producing `error: expecting expression` in llvm/ code that used these preprocessor defines.
libc/include/dlfcn.yaml uses macro_name+macro_value to define these, but then we ALSO have them listed in libc/include/llvm-libc-macros/dlfcn-macros.h.
If we were just going to define them in one, but not the other, which would we choose?
I _think_ we should just stick with libc/include/llvm-libc-macros/dlfcn-macros.h. I don't see currently what the point of macro_value/macro_name _is_. We could do something fancy with generating special values at build time, but FWICT we're not doing that at all right now.
Did I miss something, or should we just drop the macro_name/macro_value feature from hdrgen and hard code these `#define`s in the corresponding libc/include/llvm-libc-macros/*-macros.h?
cc @michaelrj-google @frobtech
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVEtr7DgT_TXqTZFGVsf9WHjRuaEhEPjgmwuXmU0jS2VLiSwZPeKbfz-U7U4yA8M8wBvJqlOnzqkqmZLtPWLD6gdWP25kySbExlv1qjHJ4rzFmDZt0O_NE7yUlMGHbBVqyEZmCCVCjx6jzKhBu075rQEjE9udGT-zPV8-RQexs165ohGYEM69DXfOtupukCqGxMRlDl-PW8OEWII0dtYj_P_78-P1-fzbr19xGT9Lr2F4B9Q2hwiTTDDJ6K3vYUCQbSgZ2J5_Ru85MHGkqC5a9DpBi_Q64pJIM3HaAjx9FNqikiUhtMU6TS-JOsheWp8WBQxKjTHN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