{"action":"created","issue":{"url":"https://api.github.com/repos/luvit/luv/issues/229","repository_url":"https://api.github.com/repos/luvit/luv","labels_url":"https://api.github.com/repos/luvit/luv/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/luvit/luv/issues/229/comments","events_url":"https://api.github.com/repos/luvit/luv/issues/229/events","html_url":"https://github.com/luvit/luv/issues/229","id":150142616,"number":229,"title":"luv fails to build in OpenBSD","user":{"login":"equalsraf","id":715238,"avatar_url":"https://avatars.githubusercontent.com/u/715238?v=3","gravatar_id":"","url":"https://api.github.com/users/equalsraf","html_url":"https://github.com/equalsraf","followers_url":"https://api.github.com/users/equalsraf/followers","following_url":"https://api.github.com/users/equalsraf/following{/other_user}","gists_url":"https://api.github.com/users/equalsraf/gists{/gist_id}","starred_url":"https://api.github.com/users/equalsraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalsraf/subscriptions","organizations_url":"https://api.github.com/users/equalsraf/orgs","repos_url":"https://api.github.com/users/equalsraf/repos","events_url":"https://api.github.com/users/equalsraf/events{/privacy}","received_events_url":"https://api.github.com/users/equalsraf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-21T17:39:49Z","updated_at":"2016-04-21T21:58:38Z","closed_at":null,"body":"Cheers\r\n\r\nI'm trying to build luv in OpenBSD 5.9, but I'm getting the following error\r\n\r\n```\r\nScanning dependencies of target luv\r\n[ 50%] Building C object CMakeFiles/luv.dir/src/luv.c.o\r\nIn file included from /root/luv/src/luv.c:41:\r\n/root/luv/src/dns.c: In function 'luv_getaddrinfo':\r\n/root/luv/src/dns.c:154: error: 'AI_V4MAPPED' undeclared (first use in this function)\r\n/root/luv/src/dns.c:154: error: (Each undeclared identifier is reported only once\r\n/root/luv/src/dns.c:154: error: for each function it appears in.)\r\n/root/luv/src/dns.c:158: error: 'AI_ALL' undeclared (first use in this function)\r\nCMakeFiles/luv.dir/build.make:62: recipe for target 'CMakeFiles/luv.dir/src/luv.c.o' failed\r\ngmake[2]: *** [CMakeFiles/luv.dir/src/luv.c.o] Error 1\r\nCMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/luv.dir/all' failed\r\ngmake[1]: *** [CMakeFiles/luv.dir/all] Error 2\r\nMakefile:127: recipe for target 'all' failed\r\ngmake: *** [all] Error 2\r\n```\r\n\r\nAFAIK OpenBSD does not have those flags, disabling the code does allow me to build e.g.\r\n\r\n```diff\r\ndiff --git a/src/dns.c b/src/dns.c\r\nindex f3446f3..8b12bfb 100644\r\n--- a/src/dns.c\r\n+++ b/src/dns.c\r\n@@ -150,13 +150,17 @@ static int luv_getaddrinfo(lua_State* L) {\r\n     if (lua_toboolean(L, -1)) hints->ai_flags |=  AI_ADDRCONFIG;\r\n     lua_pop(L, 1);\r\n \r\n+#ifdef AI_V4MAPPED\r\n     lua_getfield(L, 3, \"v4mapped\");\r\n     if (lua_toboolean(L, -1)) hints->ai_flags |=  AI_V4MAPPED;\r\n     lua_pop(L, 1);\r\n+#endif\r\n \r\n+#ifdef AI_ALL\r\n     lua_getfield(L, 3, \"all\");\r\n     if (lua_toboolean(L, -1)) hints->ai_flags |=  AI_ALL;\r\n     lua_pop(L, 1);\r\n+#endif\r\n \r\n     lua_getfield(L, 3, \"numerichost\");\r\n     if (lua_toboolean(L, -1)) hints->ai_flags |=  AI_NUMERICHOST;\r\n```\r\n\r\ncc https://github.com/neovim/neovim/issues/4620"},"comment":{"url":"https://api.github.com/repos/luvit/luv/issues/comments/213129060","html_url":"https://github.com/luvit/luv/issues/229#issuecomment-213129060","issue_url":"https://api.github.com/repos/luvit/luv/issues/229","id":213129060,"user":{"login":"equalsraf","id":715238,"avatar_url":"https://avatars.githubusercontent.com/u/715238?v=3","gravatar_id":"","url":"https://api.github.com/users/equalsraf","html_url":"https://github.com/equalsraf","followers_url":"https://api.github.com/users/equalsraf/followers","following_url":"https://api.github.com/users/equalsraf/following{/other_user}","gists_url":"https://api.github.com/users/equalsraf/gists{/gist_id}","starred_url":"https://api.github.com/users/equalsraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/equalsraf/subscriptions","organizations_url":"https://api.github.com/users/equalsraf/orgs","repos_url":"https://api.github.com/users/equalsraf/repos","events_url":"https://api.github.com/users/equalsraf/events{/privacy}","received_events_url":"https://api.github.com/users/equalsraf/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T21:58:38Z","updated_at":"2016-04-21T21:58:38Z","body":"Definitely an issue with libpthread, I dont have more time today, here is a quick log, LD_PRELOAD helps sidestep the libpthread loading after which point we also see some missing libuv symbols\r\n\r\n```\r\nexport LD_DEBUG=1\r\n(...)\r\nLuaJIT 2.1.0-beta2 -- Copyright (C) 2005-2016 Mike Pall. http://luajit.org/\r\nJIT: ON SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse\r\n> require('luv')\r\ndlopen: loading: ./luv.so\r\n flags ./luv.so = 0x0\r\nhead ./luv.so\r\nobj ./luv.so has ./luv.so as head\r\nlinking ./luv.so as dlopen()ed\r\nhead [./luv.so]\r\nexamining: './luv.so'\r\nloading: libpthread.so.20.1 required by ./luv.so\r\n flags /usr/lib/libpthread.so.20.1 = 0x68\r\ndlopen: failed to open libpthread.so.20.1\r\nunload_shlib called on ./luv.so\r\nunload_shlib unloading on ./luv.so\r\ndlopen: ./luv.so: done (failed).\r\nerror loading module 'luv' from file './luv.so':\r\n        Cannot load specified object\r\n(...)\r\n```\r\n\r\n\r\n\r\n"}}