Hello,
I've just compiled HEAD (1.5.3.4.209.g9e417) and saw a:
LINK git-http-fetch
i686-apple-darwin8-gcc-4.0.1: unrecognized option '-R/opt/local/lib'It didn't harm but the build process should be more careful to not
use options that are not supported by the compiler. And it's not a
matter of using -Wl,-rpath instead.Cheers,
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
I compile git very regularly on my MacBook Pro and have never seen
this error. Do you have the most recent copy of Xcode? I've seen
odd errors on one of the not very old versions of the developer's
tools. For me, `gcc -v` reports "gcc version 4.0.1 (Apple Computer,
Inc. build 5367)".~~ Brian
-
$ gcc -v
[...]
gcc version 4.0.1 (Apple Computer, Inc. build 5367)I've seen this message for the 1st time when compiling Git after my
nightly git pull today. Anyways, this should be done because there
is no point in trying to use a feature that doesn't exist, even
though GCC is being nice by simply issuing a warning instead of an
error.See:
http://developer.apple.com/releasenotes/DeveloperTools/RN-dyld/
index.htmlIn the section "Known Issues" it clearly states "No rpath support".
Cheers,
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
As I do not have an access to a Darwin box (nor anybody sent me
a free Mac yet), I do not have any interest in fixing it myself
nor more importantly any means to verify the result. That makes
it _your_ build process that should be more careful ;-).You know where -R is coming from and can find out what options
_your_ platform wants, so why not send in a patch _before_
complaining?-
On Darwin for instance, there is no -R or -Wl,-rpath thing to fiddle with,
it's simply not supported by the dynamic loader. This patch introduces a
NO_RPATH define which is enabled by default for Darwin.
---
Makefile | 24 ++++++++++++++++++++----
1 files changed, 20 insertions(+), 4 deletions(-)diff --git a/Makefile b/Makefile
index a1fe443..7c6c453 100644
--- a/Makefile
+++ b/Makefile
@@ -100,6 +100,9 @@ all::
# that tells runtime paths to dynamic libraries;
# "-Wl,-rpath=/path/lib" is used instead.
#
+# Define NO_RPATH if your dynamic loader doesn't support runtime paths at
+# all.
+#
# Define USE_NSEC below if you want git to care about sub-second file mtimes
# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
@@ -507,6 +510,7 @@ ifeq ($(uname_S),Darwin)
BASIC_LDFLAGS += -L/opt/local/lib
endif
endif
+ NO_RPATH = YesPlease
endififdef NO_R_TO_GCC_LINKER
@@ -521,7 +525,10 @@ ifndef NO_CURL
ifdef CURLDIR
# Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
BASIC_CFLAGS += -I$(CURLDIR)/include
- CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
+ CURL_LIBCURL = -L$(CURLDIR)/$(lib) -lcurl
+ifndef NO_RPATH
+ CURL_LIBCURL += $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)
+endif
else
CURL_LIBCURL = -lcurl
endif
@@ -539,7 +546,10 @@ endififdef ZLIB_PATH
BASIC_CFLAGS += -I$(ZLIB_PATH)/include
- EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
+ EXTLIBS += -L$(ZLIB_PATH)/$(lib)
+ifndef NO_RPATH
+ EXTLIBS += $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
+endif
endif
EXTLIBS += -lz@@ -547,7 +557,10 @@ ifndef NO_OPENSSL
OPENSSL_LIBSSL = -lssl
ifdef OPENSSLDIR
BASIC_CFLAGS += -I$(OPENSSLDIR)/include
- OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
+ OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib)
+ifndef NO_RPATH
+ OPENSSL_LINK = $(CC_LD_DYNPATH)$(OPENSS...
this and the ICONV one are missing s/=/+=/.
If we do not care about supporting too old GNU make, we can do
this by first adding this near the top:ifndef NO_RPATH
LINKER_PATH = -L$(1) $(CC_LD_DYNPATH)$(1)
else
LINKER_PATH = -L$(1)
endifand then doing something like:
CURL_LIBCURL = $(call LINKER_PATH,$(CURLDIR)/$(lib))
OPENSSL_LINK = $(call LINKER_PATH,$(OPENSSLDIR)/$(lib))to make it easier to read and less error prone.
-
No more replies on this thread, and the Apple documentation confirms
that there is no rpath support in the dynamic loader of OSX 10.4 andYes. I can rework the patch, but the question is: do you care about
old GNU make? Can I rewrite the patch with this feature?Thanks.
Cheers,
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
I know Junio is still offline but maybe someone else has an objection
against this?--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
How old of a GNU make are talking about here? The above is certainly
a lot nicer to read, but I'd hate to suddenly ship a new Git that
someone cannot compile because their GNU make is too old.GNU make is fortunately pretty easy to compile, so it shouldn't be
that difficult for someone to build a newer version if they had to,
but why make them go through all that extra work just to install
a new Git?What about using a small helper shell script and using $(shell)
instead of $(call)?So I guess in short I think I was in agreement with Junio a while
ago on this, which was that I don't want to require a newer GNU
make than we already require our users to have.--
Shawn.
-
Hi,
I seem to remember remember that we had some shell quoting in the
Makefile, and it was "call"ed. That broke some setups, so we got rid of
it.*starting "git log -Scall Makefile"*: yep. It even was me fixing it, in
39c015c556f285106931e0500f301de462b0e46e.Ciao,
Dscho-
It makes sense, since Apple's gcc/ld/dyld doesn't use rpath.
~~ Brian
-
I compile git on a MacBook Pro (OS X 10.4, gcc 4.0.1 build 5367 from the
normal Xcode install that comes on the OS install DVD) on a regular
basis. The makefile works fine for me. I suspect there's something else
going on here.-Steve
-
The rpath code is only used if you define one of the following options:
CURLDIR
ZLIB_PATH
OPENSSLDIR
ICONVDIRThe default Darwin options don't define any of these, it just relies
on finding those libraries in the library path (including /sw or /opt/
local if you have them installed).~~ Brian G.
-
| Rafael J. Wysocki | [Bug #10493] mips BCM47XX compile error |
| Ingo Molnar | [patch 02/13] syslets: add syslet.h include file, user API/ABI definitions |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Andrea Arcangeli | [PATCH 00 of 11] mmu notifier #v16 |
git: | |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Mark Lord | Re: [BUG] New Kernel Bugs |
