{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/4955","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/4955/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/4955/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/4955/events","html_url":"https://github.com/facebook/hhvm/issues/4955","id":59889811,"number":4955,"title":"hhvm static linking","user":{"login":"gopedib","id":11067044,"avatar_url":"https://avatars.githubusercontent.com/u/11067044?v=3","gravatar_id":"","url":"https://api.github.com/users/gopedib","html_url":"https://github.com/gopedib","followers_url":"https://api.github.com/users/gopedib/followers","following_url":"https://api.github.com/users/gopedib/following{/other_user}","gists_url":"https://api.github.com/users/gopedib/gists{/gist_id}","starred_url":"https://api.github.com/users/gopedib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gopedib/subscriptions","organizations_url":"https://api.github.com/users/gopedib/orgs","repos_url":"https://api.github.com/users/gopedib/repos","events_url":"https://api.github.com/users/gopedib/events{/privacy}","received_events_url":"https://api.github.com/users/gopedib/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-05T01:15:48Z","updated_at":"2015-07-30T21:26:04Z","closed_at":null,"body":"Hi, I am trying to statically compile hhvm. I have added the following in CMake/HPHPCompiler.cmake:\r\n\r\n  +  if(STATIC_LIB)\r\n  +    set(CMAKE_EXE_LINKER_FLAGS \"-static\")\r\n  +  endif()\r\n    if(STATIC_CXX_LIB)\r\n  -    set(CMAKE_EXE_LINKER_FLAGS \"-static-libgcc -static-libstdc++\")\r\n  +    set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++\")\r\n    endif()\r\n\r\nI also added in CMake/Options.cmake\r\n+  option(STATIC_LIB \"Statically link libraries\" OFF)\r\n    option(STATIC_CXX_LIB \"Statically link libstd++ and libgcc.\" OFF)\r\nand compile hhvm with:\r\ncmake -DSTATIC_LIB=ON -DSTATIC_CXX_LIB=ON .\r\n\r\nHowever, the final hhvm binary turns out to be not statically linked for few libraries (for eg. libglog and 38 more). The CMakeCache.txt shows that it is picking the *.so version from the respective library repos (for eg, here for libglog's, although it has *.a version present there)\r\n\r\n//Path to a file.\r\nLIBGLOG_INCLUDE_DIR:PATH=../../include\r\n\r\n//Path to a library.\r\nLIBGLOG_LIBRARY:FILEPATH=../../lib/libglog.so\r\n\r\nSo how am I supposed to force the cmake to pick the *.a version of those libraries while building the CMakeCache.txt? Any idea?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/126495281","html_url":"https://github.com/facebook/hhvm/issues/4955#issuecomment-126495281","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/4955","id":126495281,"user":{"login":"mancvso","id":1781459,"avatar_url":"https://avatars.githubusercontent.com/u/1781459?v=3","gravatar_id":"","url":"https://api.github.com/users/mancvso","html_url":"https://github.com/mancvso","followers_url":"https://api.github.com/users/mancvso/followers","following_url":"https://api.github.com/users/mancvso/following{/other_user}","gists_url":"https://api.github.com/users/mancvso/gists{/gist_id}","starred_url":"https://api.github.com/users/mancvso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mancvso/subscriptions","organizations_url":"https://api.github.com/users/mancvso/orgs","repos_url":"https://api.github.com/users/mancvso/repos","events_url":"https://api.github.com/users/mancvso/events{/privacy}","received_events_url":"https://api.github.com/users/mancvso/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T21:26:04Z","updated_at":"2015-07-30T21:26:04Z","body":"Any updates on this?\r\nI'm trying to get a static version to include on Alpine Linux (for use in Docker containers)"}}