Cross compiling toolchain using crosstool-ng - glibc

I am trying to build a Linux environment with glibc version 2.5 to compile C code using crosstool-ng. But I cannot find glibc version 2.5 in configuration for some reason. Does anyone know how to fix that?
And I tried to use older version glibc 2.2 and got the errors when building the library.
Installing C library headers & start files
[EXTRA] Configuring C library
[ERROR] configure: error: GNU libc requires kernel header files from
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Installing C library headers & start files'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions#257]
[ERROR] >> called from: do_libc_backend_once[scripts/build/libc/glibc-eglibc.sh-common#354]
[ERROR] >> called from: do_libc_backend[scripts/build/libc/glibc-eglibc.sh-common#149]
[ERROR] >> called from: do_libc_start_files[scripts/build/libc/glibc-eglibc.sh-common#66]
[ERROR] >> called from: main[scripts/crosstool-NG.sh#638]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: 'build.log'
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >> '/usr/crosstool-ng/share/doc/crosstool-ng/ct-ng.1.20.0/B - Known issues.txt'
[ERROR]
[ERROR] (elapsed: 24:43.44)
[24:45] / make: *** [build] Error 1
Here are all configurations I modified:
Target Option
Target Architecture x86
OS
Target OS Linux
Linux kernel version - 2.6.27.62(actually need 2.6.18 but cannot find it)
Binary utilities
binutils version 2.25
C-library
C library -- glibc 2.2 need glibc 2.5
C compiler -- gcc version 4.4.5
Can anyone tell me what's wrong with my configurations and how to fix it? Thanks.

Related

Unable to install agda via nix in macOS M1

Running
nix-shell -p agda
on macOS M1 (Monterey), compilation seems to run fine but linking fails with a segmentation error
clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 139)
error: builder for '/nix/store/0zli7b0k7mdq3aj9yrfk546vr1a1mb34-Agda-2.6.2.2.drv' failed with exit code 1;
last 10 log lines:
> [399 of 401] Compiling Agda.Compiler.JS.Compiler ( src/full/Agda/Compiler/JS/Compiler.hs, dist/build/Agda/Compiler/JS/Compiler.o, dist/build/Agda/Compiler/JS/Compiler.dyn_o )
> [400 of 401] Compiling Agda.Compiler.Builtin ( src/full/Agda/Compiler/Builtin.hs, dist/build/Agda/Compiler/Builtin.o, dist/build/Agda/Compiler/Builtin.dyn_o )
> [401 of 401] Compiling Agda.Main ( src/full/Agda/Main.hs, dist/build/Agda/Main.o, dist/build/Agda/Main.dyn_o )
> Preprocessing executable 'agda' for Agda-2.6.2.2..
> Building executable 'agda' for Agda-2.6.2.2..
> [1 of 1] Compiling Main ( src/main/Main.hs, dist/build/agda/agda-tmp/Main.o )
> Linking dist/build/agda/agda ...
> /nix/store/l1vm9w0y2fdav63xk2nfrwgzrg30hm5x-clang-wrapper-11.1.0/bin/ld: line 256: 1241 Segmentation fault: 11 /nix/store/gwm9iadcyybh7gc4q6djvaz4fb40i90c-cctools-binutils-darwin-949.0.1/bin/ld ${extraBefore+"${extraBefore[#]}"} ${params+"${params[#]}"} ${extraAfter+"${extraAfter[#]}"}
> clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
> `cc' failed in phase `Linker'. (Exit code: 139)
I did run into linking issues with other Haskell packages in recent versions of macOS, where ghc couldn't find libffi or zlib, and I had to set env variables, eg
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"¬
However, In the case of agda, from the error message it's not obvious to me what the issue is: is it caused by a C lib that the linker cannot locate, and if yes how can i discover which one? is it a problem with M1? is nix-shell -p agda suppose to work on M1?
I've finally managed to find a github issue tracking the problem (it wasn't that easy to find): https://github.com/NixOS/nixpkgs/issues/149692#issuecomment-1177684790
According to the ticket, the only available workaround at the moment is to compile for x86_64 and use Rosetta

LLVM runs into a linker error after upgrade

I have a Haskell stack project where I have been using the llvm-hs library for building a compiler which emits LLVM IR. I had been working with LLVM version 8.0.0 so far. Recently due to a Python upgrade in my system the LLVM version got bumped to 8.0.1.
When I attempt to do stack build I get the following error -
ld: warning: directory not found for option '-L/usr/local/Cellar/llvm-8/8.0.0/lib/llvm-8/lib'
ld: library not found for -lLLVM-8
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
It seems from the above that ld is looking for -L/usr/local/Cellar/llvm-8/8.0.0/lib/llvm-8/lib whereas on my system I currently have the version for 8.0.1. How do I point ld to the correct path?
I am running MacOS Mojave. stack version 2.3.1. Thanks
I was capable of solving this by adding the following to my .bash_profile
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/Cellar/llvm-8/8.0.1/lib/llvm-8/lib"
Hope this helps if someone ran into the same problem.

Gradle build fails on news mac

I try to compile my Gradle/Kotline Project on my new Mac and getting the same error 'Resource not found'-like errors for all my gradle projects. Any ideas whats wrong? The same project for example works on the latest Docker 'primetoninc/jdk'.
mac:nextlevel2017-kotline robert.rajakone$ ./gradlew build
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file:/Users/robert.rajakone/.gradle/wrapper/dists/gradle-3.5.1-all/42vjebfdws9pjts3l4bouoq0p/gradle-3.5.1/lib/gradle-base-services-3.5.1.jar) to method java.lang.ClassLoader.getPackages()
WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
:compileKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-web:.
Searched in the following locations:
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.pom
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.jar
https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.pom
https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.jar
https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.pom
https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.jar
Required by:
project :
> Could not find org.springframework.boot:spring-boot-starter-data-jpa:.
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.354 secs
mac:nextlevel2017-kotline robert.rajakone$ uname -a
Darwin mac 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
mac:nextlevel2017-kotline robert.rajakone$ ./gradlew -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/robert.rajakone/.gradle/wrapper/dists/gradle-3.5.1-all/42vjebfdws9pjts3l4bouoq0p/gradle-3.5.1/lib/groovy-all-2.4.10.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
------------------------------------------------------------
Gradle 3.5.1
------------------------------------------------------------
Build time: 2017-06-16 14:36:27 UTC
Revision: d4c3bb4eac74bd0a3c70a0d213709e484193e251
Groovy: 2.4.10
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 9 (Oracle Corporation 9+181)
OS: Mac OS X 10.12.6 x86_64
mac:nextlevel2017-kotline robert.rajakone$

Haskell Stack doesnt work correctly on OSX Sierra

I can't get haskell's stack to work on my Mac.
I installed haskell by:
brew cask install haskell-platform
Which is specified here: https://www.haskell.org/platform/mac.html#osx-homebrewcask
I've also tried installing via the downloadable package at the same site.
I do the following commands:
stack new my-project
cd my-project
stack setup
stack build
stack exec my-project-exe
Per the documentation here:
https://docs.haskellstack.org/en/stable/README/#quick-start-guide
And I immediately see this:
[1] 43017 killed stack exec my-project-exe
I've also tried many other ways of installing haskell. I've actually been able to get something compiled and executed just using cabal, but I can't then get hlint, hindent, or ghc-mod to work, they all return a similar message to the one above. I'd love to be able to work with HaskForce in IntelliJ on my Mac, but I've never had luck getting haskell to work.
System Specs
macOS 10.12.6 (16G29) (Sierra)
Fresh uninstall/reinstall of XCode (accepted terms)
brew as package manager
Here's a gif of what happens as well: https://imgur.com/gallery/afYym7m
UPDATE
I blew away all stuff related to ghc, stack, and cabal and then installed this way
https://haskell-lang.org/get-started
Writing the little HelloWorld.hs script worked fine and showed Hello, World
However, doing
stack new someproj
cd someproj
stack build
Resulted in this:
➜ someproj stack build
[1 of 2] Compiling Main ( /Users/trevord2/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/trevord2/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim ( /Users/trevord2/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Users/trevord2/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /Users/trevord2/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 ...
someproj-0.1.0.0: configure (lib + exe)
Configuring someproj-0.1.0.0...
someproj-0.1.0.0: build (lib + exe)
Preprocessing library someproj-0.1.0.0...
[1 of 1] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Lib.o )
Preprocessing executable 'someproj-exe' for someproj-0.1.0.0...
[1 of 1] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/someproj-exe/someproj-exe-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/someproj-exe/someproj-exe ...
ld: warning: ignoring file /Users/trevord2/someproj/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/libHSsomeproj-0.1.0.0-6corWoTDCA69pE1sqNF8Id.a, file was built for archive which is not the architecture being linked (x86_64): /Users/trevord2/someproj/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/libHSsomeproj-0.1.0.0-6corWoTDCA69pE1sqNF8Id.a
Undefined symbols for architecture x86_64:
"_someprojzm0zi1zi0zi0zm6corWoTDCA69pE1sqNF8Id_Lib_someFunc1_closure", referenced from:
_Main_main1_info in Main.o
_S39Z_srt in Main.o
"_someprojzm0zi1zi0zi0zm6corWoTDCA69pE1sqNF8Id_Lib_someFunc1_info", referenced from:
_Main_main_info in Main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
-- While building package someproj-0.1.0.0 using:
/Users/trevord2/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build lib:someproj exe:someproj-exe --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Which I've seen before and was actually one of my initial problems
UPDATE 2: Created GitHub Issue
Here's the issue: https://github.com/commercialhaskell/stack/issues/3487
After talking with folks on #haskell IRC they recommended I create an issue as this is very peculiar behaviour from what I understand. I'll try make sure whatever we find out here is pushed up there too.

built module is missing 64-bit support titanium

I am building module to run iOS 64bits.
I got this error, please help me to fix this.
Appcelerator: 4.1
TitaniumSDK: 4.1.0.G
Build settings from command line:
SDKROOT = iphoneos8.4
=== BUILD TARGET demomodule OF PROJECT demomodule WITH CONFIGURATION Release ===
Check dependencies
** BUILD SUCCEEDED **
Build settings from command line:
SDKROOT = iphonesimulator8.4
=== BUILD TARGET demomodule OF PROJECT demomodule WITH CONFIGURATION Release ===
Check dependencies
** BUILD SUCCEEDED **
Check build architectures
[WARN] built module is missing 64-bit support.
[WARN] architectures in manifest: x86_64, i386, arm64, armv7
[WARN] compiled binary architectures: i386, armv7
MODULE BUILD FAILED
[ERROR] there is discrepancy between the architectures specified in module manifest and compiled binary.
[ERROR] Please update manifest to match module binary architectures.

Resources