Porting the platform gcc flags support to gcc 4.7
This commit is contained in:
parent
97d81bde0c
commit
ba7cde0156
@ -118,59 +118,59 @@ let version = "4.6.3";
|
|||||||
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
||||||
in
|
in
|
||||||
"--target=${cross.config}" +
|
"--target=${cross.config}" +
|
||||||
withArch +
|
withArch +
|
||||||
withCpu +
|
withCpu +
|
||||||
withAbi +
|
withAbi +
|
||||||
withFpu +
|
withFpu +
|
||||||
(if crossMingw && crossStageStatic then
|
(if crossMingw && crossStageStatic then
|
||||||
" --with-headers=${libcCross}/include" +
|
" --with-headers=${libcCross}/include" +
|
||||||
" --with-gcc" +
|
" --with-gcc" +
|
||||||
" --with-gnu-as" +
|
" --with-gnu-as" +
|
||||||
" --with-gnu-ld" +
|
" --with-gnu-ld" +
|
||||||
" --with-gnu-ld" +
|
" --with-gnu-ld" +
|
||||||
" --disable-shared" +
|
|
||||||
" --disable-nls" +
|
|
||||||
" --disable-debug" +
|
|
||||||
" --enable-sjlj-exceptions" +
|
|
||||||
" --enable-threads=win32" +
|
|
||||||
" --disable-win32-registry"
|
|
||||||
else if crossStageStatic then
|
|
||||||
" --disable-libssp --disable-nls" +
|
|
||||||
" --without-headers" +
|
|
||||||
" --disable-threads " +
|
|
||||||
" --disable-libmudflap " +
|
|
||||||
" --disable-libgomp " +
|
|
||||||
" --disable-libquadmath" +
|
|
||||||
" --disable-shared" +
|
|
||||||
" --disable-decimal-float" # libdecnumber requires libc
|
|
||||||
else
|
|
||||||
" --with-headers=${libcCross}/include" +
|
|
||||||
" --enable-__cxa_atexit" +
|
|
||||||
" --enable-long-long" +
|
|
||||||
(if crossMingw then
|
|
||||||
" --enable-threads=win32" +
|
|
||||||
" --enable-sjlj-exceptions" +
|
|
||||||
" --enable-hash-synchronization" +
|
|
||||||
" --disable-libssp" +
|
|
||||||
" --disable-nls" +
|
|
||||||
" --with-dwarf2" +
|
|
||||||
# I think noone uses shared gcc libs in mingw, so we better do the same.
|
|
||||||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
|
||||||
# unless adding "-lsupc++" to any linking command. I don't know why.
|
|
||||||
" --disable-shared" +
|
" --disable-shared" +
|
||||||
(if cross.config == "x86_64-w64-mingw32" then
|
" --disable-nls" +
|
||||||
# To keep ABI compatibility with upstream mingw-w64
|
" --disable-debug" +
|
||||||
" --enable-fully-dynamic-string"
|
" --enable-sjlj-exceptions" +
|
||||||
else "")
|
" --enable-threads=win32" +
|
||||||
else (if cross.libc == "uclibc" then
|
" --disable-win32-registry"
|
||||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
else if crossStageStatic then
|
||||||
# and as I don't know how to pass it, I disable libgomp.
|
" --disable-libssp --disable-nls" +
|
||||||
" --disable-libgomp" else "") +
|
" --without-headers" +
|
||||||
" --enable-threads=posix" +
|
" --disable-threads " +
|
||||||
" --enable-nls" +
|
" --disable-libmudflap " +
|
||||||
" --disable-decimal-float") # No final libdecnumber (it may work only in 386)
|
" --disable-libgomp " +
|
||||||
);
|
" --disable-libquadmath" +
|
||||||
|
" --disable-shared" +
|
||||||
|
" --disable-decimal-float" # libdecnumber requires libc
|
||||||
|
else
|
||||||
|
" --with-headers=${libcCross}/include" +
|
||||||
|
" --enable-__cxa_atexit" +
|
||||||
|
" --enable-long-long" +
|
||||||
|
(if crossMingw then
|
||||||
|
" --enable-threads=win32" +
|
||||||
|
" --enable-sjlj-exceptions" +
|
||||||
|
" --enable-hash-synchronization" +
|
||||||
|
" --disable-libssp" +
|
||||||
|
" --disable-nls" +
|
||||||
|
" --with-dwarf2" +
|
||||||
|
# I think noone uses shared gcc libs in mingw, so we better do the same.
|
||||||
|
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
||||||
|
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||||
|
" --disable-shared" +
|
||||||
|
(if cross.config == "x86_64-w64-mingw32" then
|
||||||
|
# To keep ABI compatibility with upstream mingw-w64
|
||||||
|
" --enable-fully-dynamic-string"
|
||||||
|
else "")
|
||||||
|
else (if cross.libc == "uclibc" then
|
||||||
|
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||||
|
# and as I don't know how to pass it, I disable libgomp.
|
||||||
|
" --disable-libgomp" else "") +
|
||||||
|
" --enable-threads=posix" +
|
||||||
|
" --enable-nls" +
|
||||||
|
" --disable-decimal-float") # No final libdecnumber (it may work only in 386)
|
||||||
|
);
|
||||||
stageNameAddon = if crossStageStatic then "-stage-static" else
|
stageNameAddon = if crossStageStatic then "-stage-static" else
|
||||||
"-stage-final";
|
"-stage-final";
|
||||||
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
||||||
|
@ -85,77 +85,99 @@ let version = "4.7.2";
|
|||||||
|
|
||||||
javaAwtGtk = langJava && gtk != null;
|
javaAwtGtk = langJava && gtk != null;
|
||||||
|
|
||||||
/* Cross-gcc settings */
|
/* Platform flags */
|
||||||
gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
|
platformFlags = let
|
||||||
gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
|
gccArch = stdenv.lib.attrByPath [ "platform" "gcc" "arch" ] null stdenv;
|
||||||
gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
|
gccCpu = stdenv.lib.attrByPath [ "platform" "gcc" "cpu" ] null stdenv;
|
||||||
gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross;
|
gccAbi = stdenv.lib.attrByPath [ "platform" "gcc" "abi" ] null stdenv;
|
||||||
gccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null cross;
|
gccFpu = stdenv.lib.attrByPath [ "platform" "gcc" "fpu" ] null stdenv;
|
||||||
gccMode = stdenv.lib.attrByPath [ "gcc" "mode" ] null cross;
|
gccFloat = stdenv.lib.attrByPath [ "platform" "gcc" "float" ] null stdenv;
|
||||||
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
|
gccMode = stdenv.lib.attrByPath [ "platform" "gcc" "mode" ] null stdenv;
|
||||||
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
|
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
|
||||||
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
|
||||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
||||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
||||||
crossMingw = (cross != null && cross.libc == "msvcrt");
|
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
||||||
|
in
|
||||||
|
(withArch +
|
||||||
|
withCpu +
|
||||||
|
withAbi +
|
||||||
|
withFpu +
|
||||||
|
withFloat +
|
||||||
|
withMode);
|
||||||
|
|
||||||
crossConfigureFlags =
|
/* Cross-gcc settings */
|
||||||
"--target=${cross.config}" +
|
crossMingw = (cross != null && cross.libc == "msvcrt");
|
||||||
withArch +
|
crossConfigureFlags = let
|
||||||
withCpu +
|
gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
|
||||||
withAbi +
|
gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
|
||||||
withFpu +
|
gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
|
||||||
withFloat +
|
gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross;
|
||||||
withMode +
|
gccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null cross;
|
||||||
(if crossMingw && crossStageStatic then
|
gccMode = stdenv.lib.attrByPath [ "gcc" "mode" ] null cross;
|
||||||
" --with-headers=${libcCross}/include" +
|
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
|
||||||
" --with-gcc" +
|
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
|
||||||
" --with-gnu-as" +
|
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||||
" --with-gnu-ld" +
|
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
||||||
" --with-gnu-ld" +
|
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
||||||
" --disable-shared" +
|
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
||||||
" --disable-nls" +
|
in
|
||||||
" --disable-debug" +
|
"--target=${cross.config}" +
|
||||||
" --enable-sjlj-exceptions" +
|
withArch +
|
||||||
" --enable-threads=win32" +
|
withCpu +
|
||||||
" --disable-win32-registry"
|
withAbi +
|
||||||
else if crossStageStatic then
|
withFpu +
|
||||||
" --disable-libssp --disable-nls" +
|
withFloat +
|
||||||
" --without-headers" +
|
withMode +
|
||||||
" --disable-threads " +
|
(if crossMingw && crossStageStatic then
|
||||||
" --disable-libmudflap " +
|
" --with-headers=${libcCross}/include" +
|
||||||
" --disable-libgomp " +
|
" --with-gcc" +
|
||||||
" --disable-libquadmath" +
|
" --with-gnu-as" +
|
||||||
" --disable-shared" +
|
" --with-gnu-ld" +
|
||||||
" --disable-decimal-float" # libdecnumber requires libc
|
" --with-gnu-ld" +
|
||||||
else
|
|
||||||
" --with-headers=${libcCross}/include" +
|
|
||||||
" --enable-__cxa_atexit" +
|
|
||||||
" --enable-long-long" +
|
|
||||||
(if crossMingw then
|
|
||||||
" --enable-threads=win32" +
|
|
||||||
" --enable-sjlj-exceptions" +
|
|
||||||
" --enable-hash-synchronization" +
|
|
||||||
" --disable-libssp" +
|
|
||||||
" --disable-nls" +
|
|
||||||
" --with-dwarf2" +
|
|
||||||
# I think noone uses shared gcc libs in mingw, so we better do the same.
|
|
||||||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
|
||||||
# unless adding "-lsupc++" to any linking command. I don't know why.
|
|
||||||
" --disable-shared" +
|
" --disable-shared" +
|
||||||
(if cross.config == "x86_64-w64-mingw32" then
|
" --disable-nls" +
|
||||||
# To keep ABI compatibility with upstream mingw-w64
|
" --disable-debug" +
|
||||||
" --enable-fully-dynamic-string"
|
" --enable-sjlj-exceptions" +
|
||||||
else "")
|
" --enable-threads=win32" +
|
||||||
else (if cross.libc == "uclibc" then
|
" --disable-win32-registry"
|
||||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
else if crossStageStatic then
|
||||||
# and as I don't know how to pass it, I disable libgomp.
|
" --disable-libssp --disable-nls" +
|
||||||
" --disable-libgomp" else "") +
|
" --without-headers" +
|
||||||
" --enable-threads=posix" +
|
" --disable-threads " +
|
||||||
" --enable-nls" +
|
" --disable-libmudflap " +
|
||||||
" --disable-decimal-float") # No final libdecnumber (it may work only in 386)
|
" --disable-libgomp " +
|
||||||
);
|
" --disable-libquadmath" +
|
||||||
|
" --disable-shared" +
|
||||||
|
" --disable-decimal-float" # libdecnumber requires libc
|
||||||
|
else
|
||||||
|
" --with-headers=${libcCross}/include" +
|
||||||
|
" --enable-__cxa_atexit" +
|
||||||
|
" --enable-long-long" +
|
||||||
|
(if crossMingw then
|
||||||
|
" --enable-threads=win32" +
|
||||||
|
" --enable-sjlj-exceptions" +
|
||||||
|
" --enable-hash-synchronization" +
|
||||||
|
" --disable-libssp" +
|
||||||
|
" --disable-nls" +
|
||||||
|
" --with-dwarf2" +
|
||||||
|
# I think noone uses shared gcc libs in mingw, so we better do the same.
|
||||||
|
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
||||||
|
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||||
|
" --disable-shared" +
|
||||||
|
(if cross.config == "x86_64-w64-mingw32" then
|
||||||
|
# To keep ABI compatibility with upstream mingw-w64
|
||||||
|
" --enable-fully-dynamic-string"
|
||||||
|
else "")
|
||||||
|
else (if cross.libc == "uclibc" then
|
||||||
|
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||||
|
# and as I don't know how to pass it, I disable libgomp.
|
||||||
|
" --disable-libgomp" else "") +
|
||||||
|
" --enable-threads=posix" +
|
||||||
|
" --enable-nls" +
|
||||||
|
" --disable-decimal-float") # No final libdecnumber (it may work only in 386)
|
||||||
|
);
|
||||||
stageNameAddon = if crossStageStatic then "-stage-static" else
|
stageNameAddon = if crossStageStatic then "-stage-static" else
|
||||||
"-stage-final";
|
"-stage-final";
|
||||||
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
||||||
@ -308,6 +330,7 @@ stdenv.mkDerivation ({
|
|||||||
${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
|
${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
|
||||||
${if cross != null then crossConfigureFlags else ""}
|
${if cross != null then crossConfigureFlags else ""}
|
||||||
${if !bootstrap then "--disable-bootstrap" else ""}
|
${if !bootstrap then "--disable-bootstrap" else ""}
|
||||||
|
${if cross == null then platformFlags else ""}
|
||||||
";
|
";
|
||||||
|
|
||||||
targetConfig = if cross != null then cross.config else null;
|
targetConfig = if cross != null then cross.config else null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user