Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 52790 - Patch to add the AVR tool chain to crossdev.sh
Summary: Patch to add the AVR tool chain to crossdev.sh
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Joshua Kinard
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-06-02 09:29 UTC by Scott Price
Modified: 2005-03-03 17:36 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Price 2004-06-02 09:29:12 UTC
--- crossdev.sh.old	2004-06-02 07:48:40.000000000 -0500
+++ crossdev.sh		2004-06-02 11:05:47.000000000 -0500
@@ -423,6 +423,7 @@
 	echo -e "    ${CYAN}ppc${XX}\t\t- PowerPC/Apple Macintosh Systems"
 	echo -e "    ${CYAN}ppc64${XX}\t\t- PowerPC Systems (64-bit)"
 	echo -e "    ${CYAN}ppc-eabi${XX}\t- PowerPC/Embedded Systems"
+	echo -e "    ${CYAN}avr${XX}\t\t- Atmel AVR based Embedded Systems"
 
 	echo -e ""
 	echo -e "${WHITE}Options:${XX}"
@@ -679,6 +679,14 @@
 			CROSS_CHOST="sparc64-unknown-linux-gnu"
 			CROSS_KEYW="sparc"
 			;;
+		avr)
+			CROSS_CFLAGS="-mcpu=avr -mtune=avr"
+			CROSS_CHOST="avr"
+			USE_HEADERS="no"
+			CMDKERNEL="yes"
+			#// AVR is not supported by Linux at all, so use the x86 keyword
+			CROSS_KEYW="x86"
+			;;
 		*)
 			showError "Invalid arch specified!"
 			;;

Reproducible: Always
Steps to Reproduce:




I had to add the following to the patch so that crossdev.sh would build anything
without the '-u' flag.  GCC 3.3.3 is broken for the avr target on Gentoo.  See
bug 46401 ( http://bugs.gentoo.org/show_bug.cgi?id=46401 )

@@ -816,6 +824,9 @@
 		tmp_gentoo_keyw="~${tmp_gentoo_keyw} ${tmp_gentoo_keyw}"
 		local GENTOO_KEYW_TMP="~${GENTOO_KEYW} ${GENTOO_KEYW}"
 		local CROSS_KEYW_TMP="~${CROSS_KEYW} ${CROSS_KEYW}"
+	else
+		local GENTOO_KEYW_TMP="${GENTOO_KEYW}"
+		local CROSS_KEYW_TMP="${GENTOO_KEYW}"
 	fi

We still need an ebuild for avr-libc, but avr-gcc and avr-binutils can go away.
Comment 1 Daniel Black (RETIRED) gentoo-dev 2004-09-23 07:20:26 UTC
please :-)
Comment 2 Daniel Black (RETIRED) gentoo-dev 2004-09-23 20:24:10 UTC
grovell grovell :-). Please Joshua show us how good your stuff is.
Comment 3 Radek Podgorny 2004-11-03 05:34:42 UTC
Add to portage, please...
Comment 4 Pavel Semerad 2004-12-03 07:19:35 UTC
And what about adding support not only for avr, but for generic gcc target,
which will compile only kernelgcc. I did this patch and compiled
mips-dec-ultrix target as I was asked for :-) I will compile avr too, because
I am using it.


--- ./crossdev.sh.ps    2004-12-03 15:48:26.000000000 +0100
+++ ./crossdev.sh       2004-12-03 15:49:02.000000000 +0100
@@ -167,6 +167,9 @@ ParseCommandLine() {
                        --arch=*)
                                        CMDARCH="$(echo ${CMDLINE} | cut -d\= -f2)"
                                        ;;
+                       --ccflags=*)
+                                       CMDCCFLAGS="$(echo ${CMDLINE} | cut -d\= -f2)"
+                                       ;;
                        --clean|-C)
                                        CMDCLEAN="yes"
                                        ;;
@@ -423,6 +426,7 @@ displayHelp() {
        echo -e "    ${CYAN}ppc${XX}\t\t- PowerPC/Apple Macintosh Systems"
        echo -e "    ${CYAN}ppc64${XX}\t\t- PowerPC Systems (64-bit)"
        echo -e "    ${CYAN}ppc-eabi${XX}\t- PowerPC/Embedded Systems"
+       echo -e "    ${CYAN}other${XX}\t- full target spec, build only kernel compiler"

        echo -e ""
        echo -e "${WHITE}Options:${XX}"
@@ -453,6 +457,10 @@ displayHelp() {
        echo -e "               bugs."

        echo -e ""
+       echo -e "    ${GREEN}--ccflags${XX}=${CYAN}'flag passed to cross compile
r'${XX}"
+       echo -e "               Add this options to cross compiler flags."
+
+       echo -e ""
        echo -e "    ${GREEN}--pretend${XX}     (${GREEN}-p${XX} short option)"
        echo -e "               Gather all information necessary to start buildi
ng a cross-compile"
        echo -e "               toolchain, but exit after displaying the informa
tion."
@@ -680,7 +688,15 @@ GetInfo() {
                        CROSS_KEYW="sparc"                                                              ;;
                *)
-                       showError "Invalid arch specified!"
+                       #// asume arch is fully-specified target and build
+                       #// only kernel compiler
+                       CROSS_CHOST="${TARGETARCH}"
+                       CROSS_CFLAGS="${CMDCCFLAGS}"
+                       USE_HEADERS="no"
+                       CMDKERNEL="yes"
+                       CCONFIGURE="--with-gnu-as --with-gnu-ld --enable-obsolete"
+                       #// use x86 sources
+                       CROSS_KEYW="x86"
                        ;;
        esac
        CROSS_CFLAGS="${CROSS_CFLAGS} -O2 -pipe"
@@ -816,6 +832,9 @@ GetInfo() {
                tmp_gentoo_keyw="~${tmp_gentoo_keyw} ${tmp_gentoo_keyw}"
                local GENTOO_KEYW_TMP="~${GENTOO_KEYW} ${GENTOO_KEYW}"
                local CROSS_KEYW_TMP="~${CROSS_KEYW} ${CROSS_KEYW}"             +       else
+               local GENTOO_KEYW_TMP="${GENTOO_KEYW}"
+               local CROSS_KEYW_TMP="${CROSS_KEYW}"
        fi


@@ -1333,6 +1352,7 @@ InstallGccBootstrap() {
                        --enable-__cxa_atexit \
                        --with-headers=/usr/include \
                        --enable-static \
+                       ${CCONFIGURE} \
                        || showError "${func_name}: Failed to configure!"


Pavel Semerad
Comment 5 SpanKY gentoo-dev 2005-03-03 17:36:45 UTC
<=crossdev-0.4 is no longer supported ... please upgrade to crossdev-0.9 and if
you're still having problems, re-open the bug and re-assign to toolchain@gentoo.org