[MacPorts] #68340: go @1.17.13_0: environmental variables for olders macOS versions cause bash to print "wrong substitution" and thus compiles fail.
MacPorts
noreply at macports.org
Tue Oct 3 14:09:51 UTC 2023
#68340: go @1.17.13_0: environmental variables for olders macOS versions cause bash
to print "wrong substitution" and thus compiles fail.
-----------------------+--------------------
Reporter: garoffoli | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port: go
-----------------------+--------------------
I've installed Go on my Mac running 10.9.5, after the install the follow
message appears:
{{{
go has the following notes:
Please note: Go 1.21 does not build on macOS 10.12 and older, so Go
1.17.13
has been installed.
go had to be specially patched and built to work on your platform.
It likely won't work out of the box when building other projects, so
make
sure change your environment to use the following variables:
* GO_EXTLINK_ENABLED="1"
to always force go to use the external gcc or clang linker and
* GO_LDFLAGS="\"-extldflags=${configure.ldflags}\""
* CGO_LDFLAGS="-g -O2 ${configure.ldflags}"
to force-link any binary against the legacy support library. Use
exactly the
quoting provided here, even if it may look odd, or compilation will
fail.
Failure to do so will leave you unable to create binaries that use
features
not natively available on your system, either directly or through a go
core
dependency.
}}}
However, when i copy the environment variables in .profiles. Bash throws
up this error:
{{{
-bash: "-extldflags=${configure.ldflags}": wrong substitution
-bash: -g -O2 ${configure.ldflags}: wrong substitution
}}}
And because of this, i can't even compile a simple Hello World executable.
(I attached the build log)
--
Ticket URL: <https://trac.macports.org/ticket/68340>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list