This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

install-driver commands


Hello,

1. Is it intended that in `gcc/Makefile.in's install-driver rule,
   the installed executables are linked to $(target_alias)-gcc-$(version)
   without $(exeext)?  (Both cross and native installs)

2. Did you know that

	ln FILE1 FILE2
	mv [-f] FILE1 FILE2

leaves both links FILE1 and FILE2 (with "mv" as of GNU
fileutils-4.1)?  Is this POSIX or a bug (or both)?  Anyway,
it affects native gcc installation with `gcc/Makefile.in's
install-driver rule (grep for "-tmp").

The relevant commands have changed form with the DESTDIR patch,
but essentially the following continues to happen (in $(bindir)):

	rm -f $(target_alias)-gcc-$(version)
	$(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_alias)-gcc-$(version)
	rm -f $(target_alias)-gcc-tmp$(exeext)
	$(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_alias)-gcc-tmp$(exeext)
	mv $(target_alias)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext)

Note the definitions:
---snip---
GCC_INSTALL_NAME = `echo gcc|sed '$(program_transform_name)'`
GCC_TARGET_INSTALL_NAME = $(target_alias)-`echo gcc|sed '$(program_transform_name)'`
---snap---

If you configure with a --program-suffix equivalent to -$(version),
this effectively results in program_transform_name=s,$$,-$(version),
thus $(GCC_TARGET_INSTALL_NAME) equals $(target_alias)-gcc-$(version)
and you get essentially the following command sequence (in
$(bindir), disregarding $(exeext)):

	$(LN) $(GCC_INSTALL_NAME) $(GCC_TARGET_INSTALL_NAME)
	$(LN) $(GCC_INSTALL_NAME) $(target_alias)-gcc-tmp
	mv [-f] $(target_alias)-gcc-tmp $(GCC_TARGET_INSTALL_NAME)

Note that LN=ln, not ln -s.  We expect that "mv" unlinks
$(target_alias)-gcc-tmp, but this does not happen, and we end up with
an additional *-tmp executable.  Experienced on ix86-pc-linux-gnu.

I don't quite understand the insertion of the *-tmp
step.  Perhaps it was intended to make things work when
$(GCC_INSTALL_NAME)==$(GCC_TARGET_INSTALL_NAME), which currently
cannot be achieved with configure options.  Anyway, it does not
help for $(GCC_TARGET_INSTALL_NAME)==$(target_alias)-gcc-$(version),
that is, --program-suffix=-$(version), if "mv" is flawed as above.

3.  Wouldn't you like to include $(program_transform_name) in
future definitions of program_transform_cross_name?  If yes, the
cross installation commands for install-drivers should be refined
in the linking step which is essentially

	rm -f $(target_alias)-gcc-$(version)
	$(LN) $(GCC_CROSS_NAME)$(exeext) $(target_alias)-gcc-$(version)

(no *-tmp step) and thus could complain when
$(GCC_CROSS_NAME)==$(target_alias)-gcc-$(version).

Current definitions:
---snip---
program_transform_cross_name = s,^,$(target_alias)-,
[...]
GCC_CROSS_NAME = `echo gcc|sed '$(program_transform_cross_name)'`
---snap---

More concretely, imagine the following definition instead:
---
program_transform_cross_name = $(program_transform_name);s,^,$(target_alias)-,
---
Then again care must be taken when configuring with
--program-suffix=-$(version).

Regards,

Christian Cornelssen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]