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.
Older versions of mingw64 do not have the versionhelpers.h header, add
it to the dependencies submodule include/ directory and add it to
include_directories() for mingw in cmake.
Use the IsWindowsVistaOrGreater() function from VersionHelpers.h, which
fortunately is part of mingw, to check for the availability of the
comctl32 LoadIconWithScaleDown API, which we use to fix issues with the
app icon, like the icon being too big in the volume mixer.
Add -lm (the math library) to CFLAGS/CXXFLAGS/OBJCXXFLAGS/LDFLAGS and
LIBS for the cases where it is used but not explicitly linked.
Improve the sed script to override building the openal native tools as
it was failing for mingw 32 bit. Add -lm and remove flags from the
environment.
Support the gentoo crossdev mingw environment for the mingw cross
builder:
- For the cmake toolchains, add /usr/<arch>/usr to root paths, as this
is the mingw root for crossdev.
- -Wno-error=all no longer works with gcc 8.2, instead remove all
-Werror flags in dist_post_configure().
- Also remove all -I/usr/include flags in dist_post_configure().
- Don't prepend ROOT/host/bin to the PATH globally, only in
set_host_env(). This way the target config scripts are correctly found
in PATH.
- Bump openssl 1.0.2o -> 1.0.2p, cmake 3.10.3 -> 3.13.0-rc1, gd 2.2.4 ->
2.2.5 and glib 2.57.2 -> 2.58.1.
- Add libicu unicode handling library, needed by some deps. Put into the
list of dists that must be built for both the host and the target. Use
a whole bunch of patches from MSys2 for it.
- Make openssl build in parallel by using a sed script to prepend a + to
the appropriate make rules.
- Replace fontconfig EXTRA_LIBS with MAKE_ARGS: LIBS="-lintl -liconv"
because these libs were being stripped out from LIBS and LDFLAGS.
- Add V=1 VERBOSE=1 to all make invocations for extra verbosity (to see
compile/link invocations.)
- As a consequence, use dist_ninja_args() for ninja, it will still take
options in DIST_MAKE_ARGS.
- Add CONFIGURE_TYPE "cmakeninja" which is like the "cmake" type except
with -G Ninja to use the ninja generator and built with ninja. Nothing
uses this yet.
- Fix dist_patch() output for already applied patches.
- Add -L/usr/<arch>/usr/lib64 to CFLAGS/CXXFLAGS/OBJCXXFLAGS/LDFLAGS,
because crossdev libpthreads.a is in that directory and it's not in
gcc search paths. It cannot go into CPPFLAGS because those are used
for windres invocations, and windres errors out with non-cpp flags.
- Add -DMINGW_HAS_SECURE_API to all flags to fix a problem with the
mingw headers in crossdev.
- Add -lpthread to a default LIBS env var so that it's often linked last
against any libraries that may need it, at least for autoconf.
- Set the PKG_CONFIG env var to the path of the built pkg-config binary,
not exactly sure why this was necessary.
- Overhaul environment variable saving/restoring for set_host_env() so
that more variables are covered and have good host defaults.
- Add the dlfcn-win32 for mingw for dependencies that need -ldl.
- Add some MSys2 patches for fontconfig.
- Use a sed script to fix the native tools compilation when cross
compiling openal.
- Replace the fedora glib patches for mingw with MSys2 ones for the
newer glib.
- Add --with-threads=posix --disable-libelf to glib DIST_ARGS.