LLVM Cygwin build RLIMIT_RSS configuration problem

There seems to be a problem with the LLVM Cygwin configuration. Cygwin does not support the RLIMIT_RSS symbol.

llvm[1]: Compiling Program.cpp for Debug build
/usr/src/llvm/lib/System/Unix/Program.inc: In function ‘void llvm::SetMemoryLimi
ts(unsigned int)’:
/usr/src/llvm/lib/System/Unix/Program.inc:123: error: ‘RLIMIT_RSS’ was not decla
red in this scope
make[1]: *** [/usr/build/llvm/lib/System/Debug/Program.o] Error 1
make[1]: Leaving directory `/usr/build/llvm/lib/System’
make: *** [all] Error 1

I am not really up on LLVM configuration otherwise I would look into the problem myself.

Aaron

This may well actually be a problem with the Cygwin getgid() function.

Aaron

No not a problem related to getgid().

In order to get Cygwin working there is a need to add a HAVE_RLIMIT_RSS and associated logic.

Aaron

Hi Aaaron,

In order to get Cygwin working there is a need to add a
HAVE_RLIMIT_RSS and associated logic.

This was just recently added. Does cygwin even have getrlimit and
setrlimit? IIRC correctly, it doesn't. So, perhaps these functions need
to be written differently for Cygwin. What's the equivalent win32 call?

If cygwin does have getrlimit/setrlimit then we'll have to figure out
what RLIMIT_RSS should be under cygwin. Is there the notion of running
set size under cygwin?

Reid.

Hi Reid,

Cygwin 'sys/resource.h' has get/setrlimit() functions support for RLIMIT_DATA and RLIMIT_AS but not RLIMIT_RSS.

Aaron

Hi Aaron,

Hi Reid,

Cygwin 'sys/resource.h' has get/setrlimit() functions support for
RLIMIT_DATA and RLIMIT_AS but not RLIMIT_RSS.

Then, please fix it to not use RLIMIT_RSS in the cygwin case. Perhaps
you should just use RLIMIT_AS for cygwin. It will trigger sooner than
RLIMIT_RSS but that's probably okay.

Reid.

Okay I have put a #ifdef HAVE_RLIMIT_RSS round the RSS code.

There needs to be logic added to config system to complement this.

Or shall I just use an #ifdef _CYGWIN_ ?

Regarding the Bytecode writer stuff. I will try adding some inline dis-ambiguator functions.

Aaron

Okay I have put a #ifdef HAVE_RLIMIT_RSS round the RSS code.

There needs to be logic added to config system to complement this.

Or shall I just use an #ifdef _CYGWIN_ ?

Please just use #ifdef _CYGWIN_

Regarding the Bytecode writer stuff. I will try adding some inline
dis-ambiguator functions.

Yeah, I can't help you solve this problem because I don't have your
environment or compiler. However, this really smells like a compiler or
stdint.h bug to me. This code compiles fine on many unix platforms and
also under mingw.

Reid.

Please just use #ifdef _CYGWIN_

Okay

Regarding the Bytecode writer stuff. I will try adding some inline dis-ambiguator functions.

Yeah, I can't help you solve this problem because I don't have your
environment or compiler. However, this really smells like a compiler or
stdint.h bug to me. This code compiles fine on many unix platforms and
also under mingw.

Okay I'll have a look at MinGW's stdint.h against Cygwin's.

Thanks,

Aaron

Okay I'll have a look at MinGW's stdint.h against Cygwin's.

both int32_t and uint_32t are longs on Cygwin as compared to on MinGW they are int's.

I changed them in 'stdint.h' as a test and it compiles past Writer.cpp.

Not sure what to do about this in order to bring Cygwin build inline with *nix ?

The only way I can think of doing it is to provide some inline dis-ambiguation functions that would have no overhead other than source code overhead in WriterInternals.h.

Either that or patch Cygwin !

Aaron

Hello, Reid.

to be written differently for Cygwin. What's the equivalent win32 call?

I can be wrong, but there is no direct equivalent in WinAPI. AFAIK,
there are only few possibilities to set such limits on "pure" win32
subsystem.