Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 329551 - [4.6] Add gccgo support
Summary: [4.6] Add gccgo support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement with 6 votes (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://golang.org/doc/gccgo_install.html
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-23 08:34 UTC by renato gallo
Modified: 2011-01-18 07:05 UTC (History)
3 users (show)

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


Attachments
toolchain.eclass.go.diff (toolchain.eclass.go.diff,1.29 KB, patch)
2011-01-08 22:19 UTC, Ryan Hill (RETIRED)
Details | Diff
gcc-config.go.diff (gcc-config.go.diff,496 bytes, patch)
2011-01-08 22:25 UTC, Ryan Hill (RETIRED)
Details | Diff
toolchain.eclass.go.diff (toolchain.eclass.go.diff,2.16 KB, patch)
2011-01-13 02:25 UTC, Ryan Hill (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description renato gallo 2010-07-23 08:34:22 UTC
I am curious to experiment with this new language I would like to see it included into portage, here are some links:

http://golang.org/doc/install.html

The gccgo source code is a branch of the main gcc code repository: svn://gcc.gnu.org/svn/gcc/branches/gccgo. 

http://news.yahoo.com/s/pcworld/20100722/tc_pcworld/googleexecutivefrustratedbyjavaccomplexity


One idea is maybe add an use flag "google" to gcc if you want this gccgo to be compiled, so you are free to decide whether if you want it or not.

Reproducible: Always

Steps to Reproduce:
1. emerge gccgo

Actual Results:  
emerge: there are no ebuilds to satisfy "gccgo".

Expected Results:  
it compiles flawlessly

emerge --info
Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.4, glibc-2.11.2-r0, 2.6.31.6 x86_64)
=================================================================
System uname: Linux-2.6.31.6-x86_64-AMD_Phenom-tm-_9950_Quad-Core_Processor-with-gentoo-2.0.1
Timestamp of tree: Thu, 22 Jul 2010 11:30:15 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.5.4-r2, 2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     9999
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.51.0.9
sys-devel/gcc:       4.3.3-r2, 4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
virtual/os-headers:  2.6.34
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openfire/resources/security/ /usr/share/X11/xkb /usr/share/config /var/bind /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="it_IT.utf@euro"
LDFLAGS="-Wl,-O1"
LINGUAS="it en no nb"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac aalib abyss accessibility acl ads alsa amd64 amr apache2 applet archive artworkextra async asyncns authdaemond authfile autoipd automount autotrace avahi ban bash-completion beagle berkdb bluetooth bookmarks branding bugzilla build bzip2 cairo capi caps case cdda cdr celt cgi cifsupcall cisco cjk clamav clamdtop cleartype cli connection-sharing consolekit contrast cpusets cracklib crypt ctype cups curl cvs cxx dbus deflate deskbar device-mapper dga dhclient dhcpcd dirac directfb diskio djvu dlz dmx dns dri dtmf dvb dvd dvdr dvi dynamicplugin elf elisp emacs emacs22icons emf encode esd eurephia examples exchange exif expat extensible extensions extras faac faad fam fax fbcon fbcondecor ffmpeg fftw filter flac fontconfig fontforge fortran fpx ftp fuse fusion galago gcdmaster gd gdbm gdu ggi gif gimp glitz gnome gnome-keyring gnomecd gpg gphoto2 gpm graphviz gs gsf gsm gstreamer gtk guile gzip-el h224 h281 h323 hal hdri hesiod heterogeneous howl-compat http http-forms http-server iax iconv icu idn ieee1394 ifsession imagemagick imap imlib iproute2 ipv6 ivr ixj java jbig jpeg jpeg2k json kdrive kerberos krb5 lame lasi lcms ldap ldirectord lensfun libcaca libnotify libsamplerate lid lilo lirc lm_sensors lqr lzo mad maildir management mdnsresponder-compat mfd-rewrites mhash milter ming mmap mmx mng modules mono moonlight motif mozsha1 mp3 mpeg mpi mudflap multilib mysql mysqli mythtv nas nat nat-transport nautilus ncurses net network networking networkmanager nls nntp nptl nptlonly nsplugin nss odbc ogg old-daemons openexr opengl openmp openntpd openssl opensslcrypt oss overlays pam parse-clocks passwordsave pbs pccts pcre pdf perl php pic pipechan pkcs11 plotutils png policykit poll posix ppds pppd pst pulseaudio python python3 q32 q8 qt3support qt4 quotas radius rar raw readline reflection resolvconf rewrite rle romio rpm rrdcgi ruby samba sample sasl sbc schroedinger sdb-ldap sdl secure-delete semantic-desktop sendmail sensord server session shaper sip sipim sitemisc slang slp smp smux snmp sockets socks5 softquota sound speex spell spl sql sqlite srtp sse sse2 ssl startup-notification stats subversion svg swat swig sysfs syslog t1lib taglib tcl tcpd test-programs theora threads tiff timezone tk toolbar toolkit-scroll-bars tools tracker truetype tslib unicode unrar urandom usb utils v4l v4l2 vcd vda vdpau vhook vhosts vim-syntax vorbis vpb vroot vt vxml wav wavpack webdav webkit wicd winbind wmf wxwidgets x264 xcb xemacs xen xft xine xinerama xinetd xml xmlreader xmlrpc xmlwriter xmp xorg xpm xscreensaver xsl xv xvid xvmc zeroconf zlib zsh-completion" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="cgi cgid actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta charset_lite dav dav_fs dav_lock dbd deflate dir disk_cache dumpio env expires ext_filter file_cache filter headers ident imagemap include info log_config log_forensic logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_connect proxy_ftp proxy_http rewrite setenvif speling status substitute unique_id userdir usertrack version vhost_alias" APACHE2_MPMS="event" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse acecad aiptek elographics fpit hyperpen joystick mutouch penmount synaptics tslib virtualbox vmmouse void " KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it en no nb" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Prudhvi Krishna Surapaneni 2010-07-28 21:44:44 UTC
+1
Comment 2 SpanKY gentoo-dev 2010-07-28 23:27:37 UTC
please refrain from posting useless comments like that.  this bugzilla has voting enabled so use that instead.
Comment 3 renato gallo 2010-10-03 11:09:33 UTC
bump ?
Comment 4 Ryan Hill (RETIRED) gentoo-dev 2011-01-08 00:17:08 UTC
Go support is in 4.6.
Comment 5 Ryan Hill (RETIRED) gentoo-dev 2011-01-08 20:28:53 UTC
Oops, didn't mean to close this.
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2011-01-08 22:17:14 UTC
Attached are patches for the eclass and gcc-config.  Is there anywhere else that needs changes for a new language?

Two things:

Export files (.gox) are installed into /usr/lib{32,64}/go/4.6.0-pre9999/x86_64-unknown-linux-gnu which doesn't exactly match our naming conventions.  The import path is given using -I/-L on the cmd line but it seems to find them fine without it right now so I don't want to go moving stuff around.

gccgo creates a special section named .go_export in the output file which contains info about types, functions, variables, etc.  This section is then split out into a .gox file using `objcopy -j .go_export`.  I guess the idea is to separate the metadata from the compiled code.  Scanelf doesn't like these because they have writable/executable sections.  What's the best way to fix this?

Actually, it looks like the libgo.so library itself has an executable stack too...
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2011-01-08 22:19:56 UTC
Created attachment 259331 [details, diff]
toolchain.eclass.go.diff
Comment 8 Ryan Hill (RETIRED) gentoo-dev 2011-01-08 22:25:56 UTC
Created attachment 259332 [details, diff]
gcc-config.go.diff
Comment 9 SpanKY gentoo-dev 2011-01-08 23:26:47 UTC
Comment on attachment 259331 [details, diff]
toolchain.eclass.go.diff

use tc_version_is_at_least rather than >

i wonder if we should emit a warning if someone attempts to do USE="nocxx go" that go is disabled due to USE=nocxx
Comment 10 Ryan Hill (RETIRED) gentoo-dev 2011-01-08 23:50:02 UTC
tc_version_is_at_least 4.6 doesn't match 4.6.0_pre :/  not sure if it would match the snapshots either.  I can change it after the release.

Warning sounds good.
Comment 11 Ryan Hill (RETIRED) gentoo-dev 2011-01-13 02:25:15 UTC
Created attachment 259680 [details, diff]
toolchain.eclass.go.diff

objc++ and gcj also have lang_requires=c++ which gets added to enable_languages behind our backs.  fixed by making them dependent on nocxx too.

the shared lib having RWX sections has been reported upstream.
Comment 12 Ryan Hill (RETIRED) gentoo-dev 2011-01-16 05:41:00 UTC
Does gcc-config have a repo somewhere or are you just using ${FILESDIR}?  Also which version should I bump?  Were you planning on unmasking 1.5?
Comment 13 SpanKY gentoo-dev 2011-01-16 07:53:37 UTC
sounds like version_is_at_least should get tweaked to handle _pre.  we migrated away from using ">" and "<" to do version compares because it isnt actually doing a version compare.  it does a lexicographical comparison which works for the most part, but falls down in cases people dont notice.

for example:
correct: [[ 3.9 > 3.8 ]] ; echo $?
wrong: [[ 3.10 > 3.9 ]] ; echo $?

gcc-config is only maintained in FILESDIR.  i would update gcc-config 1.5 (but not bump since it isnt in ~arch).
Comment 14 Ryan Hill (RETIRED) gentoo-dev 2011-01-16 09:15:07 UTC
How about

-tc_version_is_at_least() { version_is_at_least "$1" "${2:-${GCC_PV}}" ; }
+tc_version_is_at_least() { version_is_at_least "$1" "${2:-${GCC_RELEASE_VER}}";}
Comment 15 SpanKY gentoo-dev 2011-01-18 00:57:36 UTC
since we seem to only use 2 or 3 ver components with tc_version_is_at_least, that seems like it'd be fine