BUG "make install" always strips

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

BUG "make install" always strips

Christian Jullien-3

Hi,

 

Porting tcc on OpenBSD, I discovered that “make install” always strips the tcc binaries (which failed, now fixed, in case of bootstrapping tcc with tcc  on OpenBSD) even if –strip-binaries was not set.

 

The culprit is this code:

ifeq ($(CONFIG_strip),no)

CFLAGS += -g

LDFLAGS += -g

else

CONFIG_strip = yes

ifndef CONFIG_OSX

LDFLAGS += -s

endif

endif

 

As CONFIG_strip is not set (!= no) it is forced to yes.

 

Either you pass –strip-binaries option or you install using “make install-strip” target. The “make install” should only install what has been compiled so far.

 

I fixed this by adding “CONFIG_strip=no” to

 

install: ; @$(MAKE) --no-print-directory  install$(CFG) CONFIG_strip=no

 

Hope it’s the right way to fix it, please find another solution if you like.

 

Christian


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: BUG "make install" always strips

Christian Jullien-3

With this patch I pushed on mod:

 

diff --git a/configure b/configure

index 73f5e02..d135959 100755

--- a/configure

+++ b/configure

@@ -159,6 +159,18 @@ for opt do

   esac

done

 

+# don't strip unless --strip-binaries is specified.

+# "make install-strip" still strips.

+case $"conftest" in

+  *strip=*)

+  # strip is set (to yes) keep it.

+  ;;

+  *)

+  # strip is not set, set it to no => CONFIG_strip=no

+  confvars="$confvars strip=no"

+  ;;

+esac

+

cc="${cross_prefix}${cc}"

ar="${cross_prefix}${ar}"

strip="${cross_prefix}${strip}"

 

config.mak correctly sets “CONFIG_strip=no” which is then use compare with “no” in Makefile.

 

The change you may see is that default tcc build is bigger (not stripped) which is expected.

To strip, either use –strip-binaries or install with “make install-strip”

 

C.

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=[hidden email]] On Behalf Of Christian Jullien
Sent: Sunday, January 10, 2021 06:01
To: [hidden email]
Subject: [Tinycc-devel] BUG "make install" always strips

 

Hi,

 

Porting tcc on OpenBSD, I discovered that “make install” always strips the tcc binaries (which failed, now fixed, in case of bootstrapping tcc with tcc  on OpenBSD) even if –strip-binaries was not set.

 

The culprit is this code:

ifeq ($(CONFIG_strip),no)

CFLAGS += -g

LDFLAGS += -g

else

CONFIG_strip = yes

ifndef CONFIG_OSX

LDFLAGS += -s

endif

endif

 

As CONFIG_strip is not set (!= no) it is forced to yes.

 

Either you pass –strip-binaries option or you install using “make install-strip” target. The “make install” should only install what has been compiled so far.

 

I fixed this by adding “CONFIG_strip=no” to

 

install: ; @$(MAKE) --no-print-directory  install$(CFG) CONFIG_strip=no

 

Hope it’s the right way to fix it, please find another solution if you like.

 

Christian


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: BUG "make install" always strips

Christian Jullien-3

Correct fix:

 

# don't strip unless --strip-binaries is specified.

# "make install-strip" still strips.

case "$confvars" in

  *strip*)

  # strip is set (to yes) keep it.

  ;;

  *)

  # strip is not set, set it to no => CONFIG_strip=no

  confvars="$confvars strip=no"

  ;;

esac

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=[hidden email]] On Behalf Of Christian Jullien
Sent: Wednesday, January 13, 2021 07:29
To: [hidden email]
Subject: Re: [Tinycc-devel] BUG "make install" always strips

 

With this patch I pushed on mod:

 

diff --git a/configure b/configure

index 73f5e02..d135959 100755

--- a/configure

+++ b/configure

@@ -159,6 +159,18 @@ for opt do

   esac

done

 

+# don't strip unless --strip-binaries is specified.

+# "make install-strip" still strips.

+case $"conftest" in

+  *strip=*)

+  # strip is set (to yes) keep it.

+  ;;

+  *)

+  # strip is not set, set it to no => CONFIG_strip=no

+  confvars="$confvars strip=no"

+  ;;

+esac

+

cc="${cross_prefix}${cc}"

ar="${cross_prefix}${ar}"

strip="${cross_prefix}${strip}"

 

config.mak correctly sets “CONFIG_strip=no” which is then use compare with “no” in Makefile.

 

The change you may see is that default tcc build is bigger (not stripped) which is expected.

To strip, either use –strip-binaries or install with “make install-strip”

 

C.

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=[hidden email]] On Behalf Of Christian Jullien
Sent: Sunday, January 10, 2021 06:01
To: [hidden email]
Subject: [Tinycc-devel] BUG "make install" always strips

 

Hi,

 

Porting tcc on OpenBSD, I discovered that “make install” always strips the tcc binaries (which failed, now fixed, in case of bootstrapping tcc with tcc  on OpenBSD) even if –strip-binaries was not set.

 

The culprit is this code:

ifeq ($(CONFIG_strip),no)

CFLAGS += -g

LDFLAGS += -g

else

CONFIG_strip = yes

ifndef CONFIG_OSX

LDFLAGS += -s

endif

endif

 

As CONFIG_strip is not set (!= no) it is forced to yes.

 

Either you pass –strip-binaries option or you install using “make install-strip” target. The “make install” should only install what has been compiled so far.

 

I fixed this by adding “CONFIG_strip=no” to

 

install: ; @$(MAKE) --no-print-directory  install$(CFG) CONFIG_strip=no

 

Hope it’s the right way to fix it, please find another solution if you like.

 

Christian


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: BUG "make install" always strips

grischka
In reply to this post by Christian Jullien-3
Christian Jullien wrote:
> With this patch I pushed on mod:
> ...
> +# don't strip unless --strip-binaries is specified.

I would then suggest to remove the strip options altogether,
because it's confusing and strip doesn't ssem to work reliably
either.  We already have

     ./configure --debug  (CFLAGS/LDFLAGS += -g)
and
     ./configure  (LDFLAGS += -s)

Any reason why we need more than that?

--- grischka


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel