When trying to do the necessary edits to linklibs.rsp or link.txt for
static linking, first check if the files were created by cmake,
otherwise a fatal error is generated.
For msys2 dependencies in installdeps, make sure to only install msys2
layer ccache and NOT the mingw ccache, because the mingw ccache is
completely broken.
Set the var CC_FOR_BUILD=gcc in the core build environment. This is used
by libgpg-error to make host build tools when cross compiling, may be
used by other things as well.
When connecting the debugger the debugger variable was
being set to true before setting up the dbgMain and other related
function pointers. This caused the idle loop to attempt to call dbgMain
which was still NULL. This change makes sure that debugger isn't
set to true until all function pointers are set and that when disconnecting
the remotePort variable is reset back to 0 so we can reconnect properly.
The latest version of gdb from devkitpro expects slightly
different response to some of the remote queries. For instance
when sending back the current thread id there should be no
space or dash between 'm' and the thread id. Additionally a
handful of other common remote gdb query params were
added to better support current versions of gdb
libvorbis autogen.sh calls the version-suffixed autoconf/automake
scripts, which ends up calling the wrong scripts, so remove the
autogen.sh and reconfigure manually.
Add the tables DIST_EXTRA_{CPPFLAGS,CFLAGS,CXXFLAGS,OBJCXXFLAGS} for
adjustments during builds.
Add -DSYMBOL_UNDERSCORE to DIST_EXTRA_CPPFLAGS for libffi on mingw when
the target is i686, see:
https://bugzilla.mozilla.org/show_bug.cgi?id=1336569
Also set target_bits and target_cpu appropriately in the msys2 script.
Factor out non-environment code from host_env()/target_env() into
host_env_base()/target_env_base(). Such as that for creating symlinks to
root, link host binaries to the target root, as well as calling the
hook.
Call the _base() functions from the msys2 overrides so that symlinks are
created properly, remove redundant symlink code.
https://github.com/llvm-mirror/lldb/blob/master/docs/lldb-gdb-remote.txt
The qHostInfo command is listed as a high priority to implement for gdb
stubs that lldb can connect to. Adding support for this command allows
lldb to properly connect with it's `gdb-remote 55555` command and
correctly determine the target and allow debugging.
When doing a remote memory read the debugger can ask for any size.
The buffer being allocated however was only 1024 bytes long and the
code in remoteMemoryRead also attempts to write a zero byte at the
end of the array. This code will now take the count of bytes the debugger
is trying to read and allocates a buffer that is count * 2 + 1 large. This is large
enough to hold the $02x formatted hex byte for each byte as well as the zero
byte written at the end.
If the packet passed into remotePutPacket was 1024 bytes or
larger then the buffer array would not be large enough to hold
the $, checksum and zero byte written. This now allocates a buffer
of size count + 5 to accommodate these extra characters.
Change `ln -s` to `cp` in the catgets makefile in the applied patch,
this is used for making symlinks to some header files, this will
hopefully fix building catgets for @ZachBacon on msys2. There seems to
be a problem with the mingw gcc reading headers that are symlinks, even
if they are real windows symlinks.
Also slightly refactor checking for target built files. Add the `-f`
flag for `install_artifact([-f] $dist)` for the full path to the target
file, and add the helper functions `check_install_artifact($dist)` and
`check_install_artifact_relative($dist $root_path)`.
These helper functions also display error messages if the target file
does not exist, as opposed to the previous behavior where it would just
silently exit nonzero.
Do not defer evaluating $BUILD_ENV in the msys2 host/target environment
overrides, as that causes the subsequent eval to try to run the variable
as a command.
Refactor the build environment evaluation, make build variables set
immediately so that they don't grow longer on re-evaluations and defer
all other variables. Export as many build related variables as possible.
Make one more crucial fix for cross builds: run the post_build after
LDFLAGS and LIBS are restored, so that this does not interfere with
setting and restoring the build environment for host builds.
Other changes:
- fontconfig 2.13.0 -> 2.13.1
- openal 1.19.0 -> 1.19.1
- set fontconfig configure type to autoreconf, disable tests
- disable the openssl parallel build patch, it fails unpredictably,
always build openssl with -j1
- configure libicu with --disable-tests and a few other things disabled,
the tests cause link issues on mingw i686
- also make a minor fix to libicu makefiles for mingw (replace echo -n
with printf)
- move $BUILD_ENV evaluation to the builder() main function to defer
some variable initializations
- add patch for openal to mingw-cross to use gcc instead of cmake to
build some native tools it uses, cmake causes issues with cross builds
- in host_env()/target_env() defer variable expansion and include a copy
of $BUILD_ENV in the appropriate sequence
Do not defer evaluating build env variables in mingw-cross.sh, this
interferes with switching them between host/target.
In build_dist() adjust the LDFLAGS and LIBS after pre_build has run,
because host/target env setting happens in pre_build and adjustments get
lost.
- Fix leading spaces in build env vars.
- Pass -Dcc="$CC" to the c2man metaconfig, it tries to use cc on msys2
which fails.
- Pass LDFLAGS to openssl make to fix link errors.
- Change the host_env, target_env and related functions to output a list
of commands for eval.
- Add a --host-env flag to output the host env for cross build
environments.
- Ignore symlink failures when installing dists, symlinks fail on msys2
sometimes for some reason.
- Put libicu in the list of both host and target dists only in
mingw-cross, the host libicu does not build on msys2, and everything
works fine without it.
- Add -j1 to openssl make args to disable parallel builds for the msys2
and cygwin host builds, because they fail otherwise.
- Add "-ldl -lcatgets -lws2_32" to libicu LDFLAGS for the target build,
ws2_32 may be necessary for 32 bit builds.