[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[4721]
From:       gespinasse () users ! sourceforge ! net
Date:       2010-07-11 6:09:56
Message-ID: E1OXpjg-0003Ai-Ef () sfp-svn-6 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 4721
          http://ipcop.svn.sourceforge.net/ipcop/?rev=4721&view=rev
Author:   gespinasse
Date:     2010-07-11 06:09:56 +0000 (Sun, 11 Jul 2010)

Log Message:
-----------
Change for LFS cross build

Modified Paths:
--------------
    ipcop/trunk/lfs/adjust-toolchain

Modified: ipcop/trunk/lfs/adjust-toolchain
===================================================================
--- ipcop/trunk/lfs/adjust-toolchain	2010-07-11 06:08:53 UTC (rev 4720)
+++ ipcop/trunk/lfs/adjust-toolchain	2010-07-11 06:09:56 UTC (rev 4721)
@@ -61,19 +61,15 @@
 	@$(PREBUILD)
 
 ifeq "$(STAGE)" "toolchain"
-	mv -v /$(TOOLS_DIR)/bin/ld /$(TOOLS_DIR)/bin/ld-old
-	mv -v /$(TOOLS_DIR)/$$(gcc -dumpmachine)/bin/ld /$(TOOLS_DIR)/$$(gcc \
                -dumpmachine)/bin/ld-old
-	mv -v /$(TOOLS_DIR)/bin/ld-new /$(TOOLS_DIR)/bin/ld
-	ln -sv /$(TOOLS_DIR)/bin/ld /$(TOOLS_DIR)/$$(gcc -dumpmachine)/bin/ld
+	$(LFS_TGT)-gcc -dumpspecs | sed -e 's@/lib\(64\)\?/ld@/$(TOOLS_DIR)&@g' \
+			-e "/^\*cpp:$$/{n;s,$$, -isystem /$(TOOLS_DIR)/include,}" \
+			> `dirname $$($(LFS_TGT)-gcc -print-libgcc-file-name)`/specs
 
-	gcc -dumpspecs | sed 's@$(LINKER)@/$(TOOLS_DIR)&@g' \
-		> `dirname $$(gcc -print-libgcc-file-name)`/specs
-
-	# The following needs testing
-	#GCC_INCLUDEDIR=`dirname $$(gcc -print-libgcc-file-name)`/include
-	#find $$GCC_INCLUDEDIR/* -maxdepth 0 -xtype d -exec ls -la '{}' ';'
-	#ls -la `grep -l "DO NOT EDIT THIS FILE" $$GCC_INCLUDEDIR/*`
-	#unset GCC_INCLUDEDIR
+	# test basic compiler behavior and control the right $(LINKER) is used
+	cd $(DIR_SRC) && echo 'main(){}' > dummy.c
+	cd $(DIR_SRC) && $(LFS_TGT)-gcc -B/$(TOOLS_DIR)/lib dummy.c
+	cd $(DIR_SRC) && readelf -l a.out | grep ": /$(TOOLS_DIR)$(LINKER)"
+	cd $(DIR_SRC) && rm a.out dummy.c
 endif
 
 ifeq "$(STAGE)" "base"
@@ -85,8 +81,20 @@
 	gcc -dumpspecs | sed \
 		-e 's@/$(TOOLS_DIR)$(LINKER)@$(LINKER)@g' \
 		-e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
-		-e '/\*cpp:/{n;s@$$@ -isystem /usr/include@}' > \
-		`dirname $$(gcc --print-libgcc-file-name)`/specs
+		-e '/\*cpp:/{n;s@$$@ -isystem /usr/include@}' \
+		> `dirname $$(gcc --print-libgcc-file-name)`/specs
+	
+	# test basic compiler behavior
+	cd $(DIR_SRC) && echo 'main(){}' > dummy.c
+	cd $(DIR_SRC) && cc dummy.c -v -Wl,--verbose &> dummy.log
+	# fail if improperly linked against /lib
+	cd $(DIR_SRC) && readelf -l $(DIR_SRC)/a.out | grep ': /lib'
+	cd $(DIR_SRC) && grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
+	cd $(DIR_SRC) && grep -B1 '^ /usr/include' dummy.log
+	cd $(DIR_SRC) && grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
+	cd $(DIR_SRC) && grep "/lib.*/libc.so.6 " dummy.log
+	cd $(DIR_SRC) && grep found dummy.log
+	cd $(DIR_SRC) && rm -v dummy.c a.out dummy.log
 endif
 
 	@$(POSTBUILD)


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic