Commit Graph

140 Commits

Author SHA1 Message Date
Luca Bruno
cbc83c6d0c unix: do not discard environmental LDFLAGS
The build environment may carry additional global LDFLAGS, which
are currently being discarded.
Debian uses them for distro-wide hardening, see dpkg-buildflags(1).
Fix by not overwriting the variable.

Signed-off-by: Luca Bruno <lucab@debian.org>

PR-URL: https://github.com/libuv/libuv/pull/447
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-07-20 09:43:01 +02:00
Ben Noordhuis
91d3598475 unix: add atomic-ops.h
Add cmpxchgi(), cmpxchgl() and cpu_relax() functions that we can use
as simple primitives to build spinlocks out of.

PR-URL: https://github.com/libuv/libuv/pull/197
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>

[NB: This is a back-port of commit a3c3b37 from the v1.x branch.]
2015-02-11 22:30:38 +01:00
Logan Rosen
ccd9745a68 build: link against -pthread
Please see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773341 for
more information.  Libuv uses some of pthread's symbols, but it doesn't
link against it, which causes underlinking issues, especially in Ubuntu
where we use ld --as-needed.  The issue also shows up as warnings in
Debian's build logs.

PR-URL: https://github.com/libuv/libuv/pull/73
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-18 19:14:42 +01:00
Fedor Indutny
c60d6af011 darwin: allocate enough space for select() hack
`fd_set`s are way too small for `select()` hack when stream's fd is
bigger than 1023. Make `fd_set`s a part of `uv__stream_select_t`
structure.

fix #1461

Conflicts:
	src/unix/stream.c
2014-09-08 09:09:21 +01:00
Ben Noordhuis
88a2c7ff20 build: all now builds static and dynamic lib
The `make all` target now builds both libuv.a and libuv.{so,dylib}
rather than just libuv.a.
2013-06-26 10:32:18 +02:00
Timothy J Fontaine
f84becc64e build: make HAVE_DTRACE=0 should disable dtrace 2013-06-06 20:32:52 +02:00
Brian White
c8ffee3460 freebsd: don't enable dtrace if it's not available 2013-06-05 22:50:08 +02:00
Timothy J Fontaine
55c150abfc build: only set soname on shared object builds 2013-05-13 15:48:32 -07:00
Ben Noordhuis
a11d16d8f5 build: make make test link against .a again
Commit 3eb6eb3 links the .so with -Wl,-soname which breaks the
`make test` target: run-tests is linked against (for example)
libuv.so.0.11 while the actual file name is libuv.so.

That's relatively easy to fix by getting creative with rpaths but it's
even easier to fix by simply linking statically.

It also means I no longer have to remember to set LD_BIND_NOW when
profiling the benchmarks.
2013-05-12 16:52:24 +02:00
Ben Noordhuis
3eb6eb35cc build: set soname in shared library 2013-05-12 14:50:58 +02:00
Ben Noordhuis
9b801d551b darwin: rename darwin-getproctitle.m
Rename it to darwin-getproctitle.c, it doesn't need an Objective-C
compiler. Fix up -Wpedantic warnings about void to function pointer
casts and include <ApplicationServices/ApplicationServices.h> to get
the GetCurrentProcess() function prototype.
2013-05-02 14:10:12 +02:00
Ben Noordhuis
0ff06b4ac3 build: -Wno-dollar-in-identifier-extension is clang only
Add a compiler check because turning on the option unconditionally
breaks the build when CC=gcc.

This should also fix the build on versions of OS X that predate Apple's
switch to clang (10.6 and older.)
2013-04-10 23:46:24 +02:00
Ben Noordhuis
8ea49c1223 build: squelch -Wdollar-in-identifier-extension warnings
The dtrace probes contain dollar signs. We know, llvm-gcc, and we don't
care. Suppress the warnings.
2013-04-10 14:31:39 +02:00
Ben Noordhuis
be5b16aabd build: fix dtrace-enabled out of tree build 2013-04-10 14:23:55 +02:00
Timothy J Fontaine
e1ffc6c0ee unix: dtrace probes for tick-start and tick-stop 2013-04-10 14:10:05 +02:00
Ben Noordhuis
0fb9b22ce6 build: simplify .buildstamp rule 2013-03-26 15:16:24 +01:00
Bert Belder
c7b1c53ef1 Prepare for making releases, add uv_version/uv_version_string API 2013-03-25 15:35:00 +01:00
Ben Noordhuis
1487d5aea7 build: add OBJC makefile var
Overrides the Objective-C compiler that is used. Defaults to $(CC).
2013-03-23 23:16:54 +01:00
Ben Noordhuis
a9740c9bc4 build: rename OS to PLATFORM
Rename the OS make variable to PLATFORM, it conflicts with the OS env
var. That is, running `make` when the OS env var is set, may cause
spurious build breakage.

Fixes #737.
2013-03-17 00:12:43 +01:00
Ben Noordhuis
dd20025207 build: make clean target remove all build artifacts 2013-02-27 22:09:11 +01:00
Ben Noordhuis
e89aced8d6 darwin: implement uv_set_process_title, part 2
Make changes to the process title visible to tools like `ps`.

The argv clobber technique is reasonably portable across Unices;
the common code has been moved into src/unix/proctitle.c and is used
on Linux and OS X. Other platforms will probably follow in the future.
2013-02-24 03:56:02 +01:00
Ben Noordhuis
14eb8b0391 darwin: implement uv_set_process_title, part 1
Apply undocumented Carbon magic to change the process title in a way
that's visible in the Activity Monitor.
2013-02-24 03:54:02 +01:00
Ben Noordhuis
fd24a69c52 build: fix shared-after-static build
Executing `make libuv.so` after `make libuv.a` failed because the
libuv.a target compiled the files in src/ without -fPIC.

Make the libuv.so target depend on files with a different suffix to
keep them separated.
2013-02-20 19:53:17 +01:00
Ben Noordhuis
40a9e119ff build: fix up dependency rules
* Auto-create build subdirectories.

* Add coarse dependencies on header files so make rebuilds the sources
  whenever the headers change.
2013-01-29 17:07:41 +01:00
Ben Noordhuis
b607a7fed7 linux: move files out of src/unix/linux
Flattens the source tree and simplifies the Makefile.
2013-01-29 17:07:41 +01:00
Ben Noordhuis
75dea933eb build: support out of tree builds
Invoking make with builddir_name=/path/to/dir builds libuv in the
designated directory.
2013-01-29 17:07:25 +01:00
Ben Noordhuis
01fe4e73a6 build: add OS= make switch
Overrides the platform detection heuristic. Useful for cross-compiling.
2013-01-29 14:44:13 +01:00
Ben Noordhuis
9eedd32e40 build: make clean target remove libuv.{a,so,dylib} 2013-01-09 17:26:21 +01:00
Vlad Tudose
4b115f89bf build: build libuv.a and libuv.so in different dirs
Fixes #659.
2012-12-19 15:34:19 +01:00
Ben Noordhuis
b4168cd697 build: rename LINKFLAGS to LDFLAGS 2012-12-08 08:06:12 +01:00
Ben Noordhuis
7306c5ff46 build: fix make libuv.so CFLAGS=<options>
Running a make target that builds the shared object while overriding the CFLAGS
variable from the command line, would fail with a relocation error:

   relocation R_X86_64_32 against `.text' can not be used when making a shared
   object; recompile with -fPIC

Fix that by adding -fPIC unconditionally.
2012-12-08 08:04:08 +01:00
Ben Noordhuis
172d495bb8 build: fix dragonflybsd build, link with libkvm 2012-11-19 23:57:29 +01:00
Ben Noordhuis
3e9344fd34 build: remove unused EV_CONFIG var 2012-11-19 23:53:41 +01:00
Ben Noordhuis
665a316aa9 unix: remove libev 2012-11-16 17:33:29 +01:00
Ben Noordhuis
62332ea090 build: fix make test on darwin and sunos 2012-11-10 01:43:42 +01:00
Ben Noordhuis
20eaa84c4f build: link test runner with -rpath
Link the test runner with -rpath=/path/to/libuv.so, don't muck around with
LD_LIBRARY_PATH.
2012-11-09 02:19:07 +01:00
Ben Noordhuis
43d52c77ba test: make make test link against .so 2012-11-08 18:28:57 +01:00
Ben Noordhuis
cc36fd0366 build: support building a .so
This commit adds support to the regular Makefile as opposed to the gyp build.
2012-11-08 18:28:27 +01:00
Ben Noordhuis
47b2cd31c9 build: rename uv.a to libuv.a 2012-10-11 14:32:06 +02:00
Ben Noordhuis
b60a24a206 unix: remove libeio 2012-10-01 22:53:59 +02:00
Ben Noordhuis
74999f8f99 unix: port fs and work api to new thread pool 2012-10-01 22:53:59 +02:00
Ben Noordhuis
f35a4b628a unix: add custom thread pool 2012-10-01 22:53:59 +02:00
Ben Noordhuis
7ac23ee0c6 unix: move getaddrinfo code to getaddrinfo.c 2012-09-28 08:05:53 +02:00
Andrew Paprocki
900ad30b43 aix: add initial platform support for aix using gcc/gxlc
Adds initial libuv build/platform support for AIX. Builds work using gcc or the
IBM XL C compiler using its gxlc wrapper. Platform support is added for
uv_hrtime, uv_exepath, uv_get_free_memory, uv_get_total_memory, uv_loadavg,
uv_uptime, uv_cpu_info, uv_interface_addresses.
2012-09-14 01:23:28 +02:00
Fedor Indutny
f8e7513a06 darwin: use FSEvents to watch directory changes 2012-09-12 23:38:57 +02:00
Shigeki Ohtsu
57e6113683 unix: support missing api on NetBSD 2012-09-11 17:23:43 +02:00
Ben Noordhuis
ee50db6e36 unix, windows: preliminary signal handler support
* a no-op on Windows for now
* only supports the main loop on UNIX (again, for now)
2012-08-10 02:00:07 +02:00
Bert Belder
41b1265af8 Rip out c-ares 2012-08-07 01:04:26 +02:00
Bert Belder
a069956996 Remove c-ares integrations 2012-08-07 01:03:52 +02:00
Bert Belder
32f93e14cb Add libuv-ified versions of inet_pton and inet_ntop 2012-08-07 01:03:47 +02:00