New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Cygwin #108

Open
GVdP-Travix opened this Issue Nov 18, 2014 · 7 comments

Comments

Projects
None yet
3 participants
@GVdP-Travix
Copy link

GVdP-Travix commented Nov 18, 2014

Hello,
Newb here, but I wanted to say I had all kind of issues building nghttp2 on Cygwin, but was able to solve them and wanted to leave a message for posterity.

  1. Clang won't work. It stops with lots of errors like the following:

    .libs/nghttp2_pq.o:fake:(.debug_info+0xce): relocation truncated to fit: R_X86_64_32 against `.debug_ranges'
    
    .libs/nghttp2_map.o:fake:(.debug_info+0xea): relocation truncated to fit: R_X86_64_32 against `.debug_ranges'
    
    .libs/nghttp2_map.o:fake:(.debug_info+0x2b5): relocation truncated to fit: R_X86_64_32 against `.debug_ranges'
    
    .libs/nghttp2_map.o:fake:(.debug_info+0x2db): relocation truncated to fit: R_X86_64_32 against `.debug_ranges'
    
    .libs/nghttp2_frame.o:fake:(.debug_info+0xcd5): relocation truncated to fit: R_X86_64_32 against `.debug_ranges'
    
    
  2. It needed libspdylay (which I built from scratch), even if configure didn't find it

  3. It needed libjansson (which I built from scratch), even if configure didn't find it

  4. Use of strptime needs the flag __STRICT_ANSI__ undeclared.

I was finally able to build it after building libspdylay, libjansson, with
./configure --prefix=/usr/local CXXFLAGS=-U__STRICT_ANSI__

Why would configure say it wasn't building with jansson and spylay, but the compiler complain if they weren't present?

Thx

@tatsuhiro-t

This comment has been minimized.

Copy link
Collaborator

tatsuhiro-t commented Nov 19, 2014

I fixed libjansson requirement in recent commit.
I can successfully built without libspdylay on linux. So I think it should work, but I'm not sure why it fails on cygwin.

@ayanamist

This comment has been minimized.

Copy link
Contributor

ayanamist commented Dec 23, 2015

I fix problem 2 by setting
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
then configure found spdylay

also since cygwin does not have initgroups in grp.h, i have to add #ifndef __CYGWIN__ to shrpx_worker_process.cc to avoid compilation failure.

@tatsuhiro-t

This comment has been minimized.

Copy link
Collaborator

tatsuhiro-t commented Dec 23, 2015

@ayanamist thank you. I added a code to detect the availability of initgroups in configure, and guarded initgroups usage based on it. See 5de2c7a.

@ayanamist

This comment has been minimized.

Copy link
Contributor

ayanamist commented Dec 23, 2015

@tatsuhiro-t Good job, so i don't need to patch it next time

@ayanamist

This comment has been minimized.

Copy link
Contributor

ayanamist commented Dec 24, 2015

@tatsuhiro-t sorry to bother, but i test 1.6 release today, found strange thing, from my config.log and config.status i see#define HAVE_INITGROUPS 1 so it still try to compile initgroups related code and fails.

The whole config.log is here: http://pastebin.com/NutP3kdj

@tatsuhiro-t

This comment has been minimized.

Copy link
Collaborator

tatsuhiro-t commented Dec 24, 2015

Looks like cygwin actually has initgroups, but it is undefined in header file because of our feature test macro (probably _XOPEN_SOURCE).
I think 8919c8c fixes this.

@ayanamist

This comment has been minimized.

Copy link
Contributor

ayanamist commented Dec 25, 2015

I just test 894c1bd and it compiles and works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment