# [PATCH] Fix linking with OpenSSL

5 messages from 2006-05-04 to 2006-05-05. Participants: Alexey Dobriyan, Junio C Hamano.
Thread: https://gitlist.dev/t/4059

## Alexey Dobriyan, 2006-05-04 22:25

Subject: [PATCH] Fix linking with OpenSSL
Message-ID: <20060504222550.GA7236@mipter.zuzino.mipt.ru>
URL: https://gitlist.dev/e/20060504222550.GA7236%40mipter.zuzino.mipt.ru

```
For those who put it into interesting (read: default) place.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

--- a/Makefile
+++ b/Makefile
@@ -559,7 +559,7 @@ git-http-push$X: revision.o http.o http-
 
 git-rev-list$X: rev-list.o $(LIB_FILE)
 	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-		$(LIBS) $(OPENSSL_LIBSSL)
+		$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
 
 init-db.o: init-db.c
 	$(CC) -c $(ALL_CFLAGS) \

```

## Junio C Hamano, 2006-05-04 22:38

Subject: Re: [PATCH] Fix linking with OpenSSL
Message-ID: <7vwtd12z6h.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vwtd12z6h.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060504222550.GA7236@mipter.zuzino.mipt.ru>

```
Alexey Dobriyan <adobriyan@gmail.com> writes:

> For those who put it into interesting (read: default) place.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>
> --- a/Makefile
> +++ b/Makefile
> @@ -559,7 +559,7 @@ git-http-push$X: revision.o http.o http-
>  
>  git-rev-list$X: rev-list.o $(LIB_FILE)
>  	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
> -		$(LIBS) $(OPENSSL_LIBSSL)
> +		$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
>  
>  init-db.o: init-db.c
>  	$(CC) -c $(ALL_CFLAGS) \

We used to depend on bignum from openssl for rev-list
(merge-order), and if I remember correctly that was the only
reason built recipe for rev-list is different from other
programs.  I wonder if we can just get rid of this thing, and
have it built with git-%$X rule like everybody else.

Can somebody try that out and report what happens?

```

## Junio C Hamano, 2006-05-04 23:00

Subject: Re: [PATCH] Fix linking with OpenSSL
Message-ID: <7vslnp2y5x.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vslnp2y5x.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <7vwtd12z6h.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> writes:

> Alexey Dobriyan <adobriyan@gmail.com> writes:
>
>> For those who put it into interesting (read: default) place.
>>
>> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>>
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -559,7 +559,7 @@ git-http-push$X: revision.o http.o http-
>>  
>>  git-rev-list$X: rev-list.o $(LIB_FILE)
>>  	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
>> -		$(LIBS) $(OPENSSL_LIBSSL)
>> +		$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
>>  
>>  init-db.o: init-db.c
>>  	$(CC) -c $(ALL_CFLAGS) \
>
> We used to depend on bignum from openssl for rev-list
> (merge-order), and if I remember correctly that was the only
> reason built recipe for rev-list is different from other
> programs.  I wonder if we can just get rid of this thing, and
> have it built with git-%$X rule like everybody else.
>
> Can somebody try that out and report what happens?

Well, I did.  Alexey, does this work for you?

-- >8 --

diff --git a/Makefile b/Makefile
index a3f7e92..814010d 100644
--- a/Makefile
+++ b/Makefile
@@ -564,10 +564,6 @@ git-http-push$X: revision.o http.o http-
 	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 		$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
 
-git-rev-list$X: rev-list.o $(LIB_FILE)
-	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-		$(LIBS) $(OPENSSL_LIBSSL)
-
 init-db.o: init-db.c
 	$(CC) -c $(ALL_CFLAGS) \
 		-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $*.c

```

## Alexey Dobriyan, 2006-05-05 07:57

Subject: Re: [PATCH] Fix linking with OpenSSL
Message-ID: <20060505075754.GA7237@mipter.zuzino.mipt.ru>
URL: https://gitlist.dev/e/20060505075754.GA7237%40mipter.zuzino.mipt.ru
In-Reply-To: <7vslnp2y5x.fsf@assigned-by-dhcp.cox.net>

```
On Thu, May 04, 2006 at 04:00:26PM -0700, Junio C Hamano wrote:
> Junio C Hamano <junkio@cox.net> writes:
> > Alexey Dobriyan <adobriyan@gmail.com> writes:
> >> For those who put it into interesting (read: default) place.
> >>
> >> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> >>
> >> --- a/Makefile
> >> +++ b/Makefile
> >> @@ -559,7 +559,7 @@ git-http-push$X: revision.o http.o http-
> >>  
> >>  git-rev-list$X: rev-list.o $(LIB_FILE)
> >>  	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
> >> -		$(LIBS) $(OPENSSL_LIBSSL)
> >> +		$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
> >>  
> >>  init-db.o: init-db.c
> >>  	$(CC) -c $(ALL_CFLAGS) \
> >
> > We used to depend on bignum from openssl for rev-list
> > (merge-order), and if I remember correctly that was the only
> > reason built recipe for rev-list is different from other
> > programs.  I wonder if we can just get rid of this thing, and
> > have it built with git-%$X rule like everybody else.
> >
> > Can somebody try that out and report what happens?
> 
> Well, I did.  Alexey, does this work for you?

It does. It also crashes busybox patch applet. Oh, well...

> --- a/Makefile
> +++ b/Makefile
> @@ -564,10 +564,6 @@ git-http-push$X: revision.o http.o http-
>  	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
>  		$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
>  
> -git-rev-list$X: rev-list.o $(LIB_FILE)
> -	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
> -		$(LIBS) $(OPENSSL_LIBSSL)
> -
>  init-db.o: init-db.c
>  	$(CC) -c $(ALL_CFLAGS) \
>  		-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $*.c

```

## Junio C Hamano, 2006-05-05 08:02

Subject: Re: [PATCH] Fix linking with OpenSSL
Message-ID: <7vpsis2921.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vpsis2921.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060505075754.GA7237@mipter.zuzino.mipt.ru>

```
Alexey Dobriyan <adobriyan@gmail.com> writes:

> It does. It also crashes busybox patch applet. Oh, well...

Could you elaborate on "busybox patch" problem?

```
