unable to install go1.1.2

88 views
Skip to first unread message

Manlio Perillo

unread,
Apr 22, 2021, 5:06:09 AM4/22/21
to golang-nuts
I tried to install go1.1.2 on my system, without success.

I encountered the following problems:

  1.  There is no binary release
  2. Compilation fails due to warnings:
        warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE
        I solved by removing the `-Werror` option
   3.  The linker reported the error
         ld: -r and -pie may not be used together
         I solved by renaming the `-Wl,r` option with `-r`

The last error is
cannot load DWARF output from $WORK/net/_obj//_cgo_.o: decoding dwarf section info at offset 0x4: unsupported version 0

Any idea?

Thanks
Manlio 

Brian Candler

unread,
Apr 22, 2021, 5:24:41 AM4/22/21
to golang-nuts
Could you describe what platform you are trying to build on?

Also, could you explain why you need to build such an ancient version? There may be a better solution to whatever you're trying to do.

Manlio Perillo

unread,
Apr 22, 2021, 5:46:15 AM4/22/21
to golang-nuts
Il giorno giovedì 22 aprile 2021 alle 11:24:41 UTC+2 Brian Candler ha scritto:
Could you describe what platform you are trying to build on?

Also, could you explain why you need to build such an ancient version? There may be a better solution to whatever you're trying to do.

My platform is linux/amd64, and  I'm building it for fun.

When using https://github.com/perillo/go-compatible on my projects, I found that one of them is compatible with go1.2, and I was curious to know if it is compatible with go1.1 too.

About the gcc warnings, the _BSD_SOURCE and _SVID_SOURCE macros where defined in include/u.h; after removing them I got 2 other warnings:

   -  argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination?
   - 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length

from cmd/pack/ar.c.

Thanks
Manlio

Manlio Perillo

unread,
Apr 22, 2021, 5:56:00 AM4/22/21
to golang-nuts

Il giorno giovedì 22 aprile 2021 alle 11:46:15 UTC+2 Manlio Perillo ha scritto:
> [...]
 
About the gcc warnings, the _BSD_SOURCE and _SVID_SOURCE macros where defined in include/u.h; after removing them I got 2 other warnings:

   -  argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination?
   - 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length

from cmd/pack/ar.c.

Thanks
Manlio

Brian Candler

unread,
Apr 22, 2021, 5:57:26 AM4/22/21
to golang-nuts
Ah well, if it's just for fun then please knock yourself out, but don't be surprised if compiling old code on new compilers turns up problems like this.  My suggestion is firing up a VM containing a Linux distribution of similar vintage (say Ubuntu 12.04) and compile inside that.

Aside: you'd probably have more luck building go1.4.  This was the last version of go to be written in C, and as a result it plays a special role, as it allows you to bootstrap the go compiler chain from scratch, without depending on a pre-existing go compiler.  Therefore it has accumulated fixes to keep it building on more recent compilers, and the git history of that branch may give you some clues.

Manlio Perillo

unread,
Apr 22, 2021, 8:45:52 AM4/22/21
to golang-nuts
The solution was to simply remove the `-Werror` warning in cmd/dist and disable CGO with CGO_ENABLED=0
 

Brian Candler

unread,
Apr 22, 2021, 10:27:14 AM4/22/21
to golang-nuts
On Thursday, 22 April 2021 at 13:45:52 UTC+1 manlio....@gmail.com wrote:
The solution was to simply remove the `-Werror` warning in cmd/dist and disable CGO with CGO_ENABLED=0

Glad it's working. That's also one of the things you'll find in the commit history of 1.4.
Reply all
Reply to author
Forward
0 new messages