From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 22:01:22 2015 Return-Path: Delivered-To: svn-src-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14516D04; Sat, 13 Jun 2015 22:01:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 026579D8; Sat, 13 Jun 2015 22:01:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5DM1L0T025600; Sat, 13 Jun 2015 22:01:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5DM1LCV025599; Sat, 13 Jun 2015 22:01:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201506132201.t5DM1LCV025599@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 13 Jun 2015 22:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284356 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2015 22:01:22 -0000 Author: adrian Date: Sat Jun 13 22:01:21 2015 New Revision: 284356 URL: https://svnweb.freebsd.org/changeset/base/284356 Log: Fix up crunchgen binary generation to work with external cross-build tools. * Allow STRIP to be overridden by the environment * Use CC to tie things together, not LD Tested: * i386, mips32 Submitted by: kan Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Sat Jun 13 20:15:44 2015 (r284355) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Sat Jun 13 22:01:21 2015 (r284356) @@ -980,6 +980,7 @@ top_makefile_rules(FILE *outmk) prog_t *p; fprintf(outmk, "LD?= ld\n"); + fprintf(outmk, "STRIP?= strip\n"); if ( subtract_strlst(&libs, &libs_so) ) fprintf(outmk, "# NOTE: Some LIBS declarations below overridden by LIBS_SO\n"); @@ -1027,7 +1028,7 @@ top_makefile_rules(FILE *outmk) fprintf(outmk, "\t$(CC) -static -o %s %s.o $(CRUNCHED_OBJS) $(LIBS)\n", execfname, execfname); fprintf(outmk, ".endif\n"); - fprintf(outmk, "\tstrip %s\n", execfname); + fprintf(outmk, "\t$(STRIP) %s\n", execfname); fprintf(outmk, "realclean: clean subclean\n"); fprintf(outmk, "clean:\n\trm -f %s *.lo *.o *_stub.c\n", execfname); fprintf(outmk, "subclean: $(SUBCLEAN_TARGETS)\n"); @@ -1109,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t fprintf(outmk, " $(%s_LIBS)", p->ident); fprintf(outmk, "\n"); - fprintf(outmk, "\t$(LD) -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", + fprintf(outmk, "\t$(CC) -nostdlibs -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) fprintf(outmk, " $(%s_LIBS)", p->ident);