Skip to content

[libc][hdrgen] macro_name/macro_value duplicates defines from libc/include/llvm-libc-macros/*-macros.h #124957

@nickdesaulniers

Description

@nickdesaulniers

I just noticed that our generated dlfcn.h has:

#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, rather than redefining them, 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 #defines in the corresponding libc/include/llvm-libc-macros/*-macros.h?

cc @michaelrj-google @frobtech

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions