[libc-commits] [libc] [libc] Add IPv4 socket options and related structs (PR #204787)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Tue Jun 23 07:16:17 PDT 2026


================
@@ -455,6 +455,51 @@ add_proxy_header_library(
     libc.include.netinet_in
 )
 
+add_proxy_header_library(
+  struct_ip_mreq
+  HDRS
+    struct_ip_mreq.h
+  FULL_BUILD_DEPENDS
+    libc.include.llvm-libc-types.struct_ip_mreq
+    libc.include.netinet_in
+)
+
+add_proxy_header_library(
+  struct_ip_mreq_source
+  HDRS
+    struct_ip_mreq_source.h
+  FULL_BUILD_DEPENDS
+    libc.include.llvm-libc-types.struct_ip_mreq_source
+    libc.include.netinet_in
----------------
labath wrote:

So, I have to admit I cargo culted this (nearly all proxy headers have this form) without giving it much thought.

After giving it some thought, I think it is correct that the `DEPENDS` argument is empty -- in an overlay build, all this header does is include <netinet/in.h> from the system library, which is an ambient header that is assumed to exists and so (I think) doesn't need to be tracked as a dependency.

The thing I don't understand is why does not need to depend on libc.include.netinet_in target in *any* build mode. It is true that this type is a part of that header, but I don't see why we'd have to build the whole header just to include a part of it. I'm going to try to see what happens if I remove that, for science. But ideally I wouldn't want to start doing that in this PR, as this is by large the prevailing pattern in this file.

https://github.com/llvm/llvm-project/pull/204787


More information about the libc-commits mailing list