我不喜欢默认的c编译 abcdefghijklmnclang
由termux提供。有没有办法在我的任期环境中获得GNU GCC?
我不喜欢默认的c编译 abcdefghijklmnclang
由termux提供。有没有办法在我的任期环境中获得GNU GCC?
I don't like the default C compiler clang
provided by Termux. Is there a way I can get GNU GCC in my Termux environment?
获得gcc的另一种方法是将托管的社区repo添加在 https://github.com/its-pointless/its-pointless.github.io 。来源(或多或少)在 https://github.com/its-pointless/gcc_termux。
可用的其他流行包包括numpy和scipy。
有关此和其他社区存储库的更多信息,可以在 termux wiki 中找到。
要将此特定存储库添加到Termux环境,运行: # Get some needed tools. coreutils for mkdir command, gnugp for the signing key, and apt-transport-https to actually connect to the repo apt-get update apt-get --assume-yes upgrade apt-get --assume-yes install coreutils gnupg2 apt-transport-https wget # Make the sources.list.d directory mkdir $PREFIX/etc/apt/sources.list.d # Write the needed source file - Added Missing "> character on line below echo "deb [trusted=yes] https://its-pointless.github.io/files/ termux extras" > $PREFIX/etc/apt/sources.list.d/pointless.list # Download signing key from https://its-pointless.github.io/pointless.gpg wget https://its-pointless.github.io/pointless.gpg apt-key add pointless.gpg # Update apt apt update
(从 https://github.com/its-pointless/its-pointless.github.io/blob/master/setup-pintess -repo.sh
Another way to get gcc would be to add the community repo hosted by its-pointless at https://github.com/its-pointless/its-pointless.github.io. Sources are (more or less) available at https://github.com/its-pointless/gcc_termux.
Other popular packages available includes numpy and scipy.
More information about this and other community repositories can be found in the termux wiki.
To add this particular repository to your termux environment, run:
# Get some needed tools. coreutils for mkdir command, gnugp for the signing key, and apt-transport-https to actually connect to the repo apt-get update apt-get --assume-yes upgrade apt-get --assume-yes install coreutils gnupg2 apt-transport-https wget # Make the sources.list.d directory mkdir $PREFIX/etc/apt/sources.list.d # Write the needed source file - Added Missing "> character on line below echo "deb [trusted=yes] https://its-pointless.github.io/files/ termux extras" > $PREFIX/etc/apt/sources.list.d/pointless.list # Download signing key from https://its-pointless.github.io/pointless.gpg wget https://its-pointless.github.io/pointless.gpg apt-key add pointless.gpg # Update apt apt update
(instructions taken from https://github.com/its-pointless/its-pointless.github.io/blob/master/setup-pointless-repo.sh)
这是一个非常有趣的解决方案。
首次下载 gcc for c4droid 来自google播放。
go找到它的apk下 /data/app/com.n0n3m4.gcc4droid-#
,拍摄APK并提取 Abcdefghijklmnabcdefghijklmn2
。现在提取 gcc.zip
到
/data/data/com.termux/files/usr/libexec
应用<代码> chmod -R 644 到整个文件夹和 chmod -R 755 到<代码> ARCH/bin ,<代码> bin 和
libexec 。将gcc程序链接到
/data/app/com.n0n3m4.gcc4droid-#0
,您将能够使用gcc而不是clang。记得在编译可执行文件时添加 /data/app/com.n0n3m4.gcc4droid-#1
。
This is a very interesting solution.
First download GCC for C4droid from Google Play.
Go find its apk under /data/app/com.n0n3m4.gcc4droid-#
, take the APK and extract /assets/gcc.zip
. Now extract gcc.zip
to
/data/data/com.termux/files/usr/libexec
Apply chmod -R 644
to the whole folder and chmod -R 755
to ARCH/bin
, bin
and libexec
. Link gcc programs to $PREFIX/bin
and you'll be able to use GCC instead of Clang. Remember to add -pie
when compiling executables.
在Termux Proot中安装Arch Linux以获得完整的Linux开发环境。 查看 https://sdrausty.githubub.io/termuxarch/docs/install 安装指示。使用 /data/app/com.n0n3m4.gcc4droid-#2
安装包括gcc的开发人员的环境。
Install Arch Linux in Termux PRoot to get a full Linux development environment. See https://sdrausty.github.io/TermuxArch/docs/install for installation instructions. Use pacman -S base base-devel
to install the developer's environment which includes GCC.
我用gcc 10.2.0创建了termux repo,有方法如何安装 https:// cctools.info/index.php/termux_repository_with_cctools_packages_(gcc_with_fortran_support_etc)
添加cccools packages public键:
/data/app/com.n0n3m4.gcc4droid-#3
创建一个新的存储库列表:
/data/app/com.n0n3m4.gcc4droid-#4
更新包列表:
/data/app/com.n0n3m4.gcc4droid-#5
安装包gcc-cctools(它将自动安装binutils-cctools):
/data/app/com.n0n3m4.gcc4droid-#6
为Android架构安装NDK包,使用最新一个,例如用于AARCH64:
/data/app/com.n0n3m4.gcc4droid-#7
显示AARCH64的所有NDK Sycsroots:
/data/app/com.n0n3m4.gcc4droid-#8
将新编译器添加到路径:
/data/app/com.n0n3m4.gcc4droid-#9
检查:
/assets/gcc.zip0
I created termux repo with gcc 10.2.0, there how to install https://cctools.info/index.php/Termux_repository_with_cctools_packages_(gcc_with_fortran_support_etc)
Add cctools packages public key:
wget -O - https://cctools.info/public.key | apt-key add -
Create a new repository list:
echo "deb https://cctools.info termux cctools" > $PREFIX/etc/apt/sources.list.d/cctools.list
Update packages lists:
apt update
Install the package gcc-cctools(it will install binutils-cctools automatically):
apt install gcc-cctools
Install the NDK package for your android architecture, use the latest one, for example for aarch64:
apt install ndk-sysroot-cctools-api-26-aarch64
To show all ndk sysroots for aarch64:
apt search ndk-sysroot-cctools | grep aarch64
Add directory with new compilers to PATH:
export PATH=$PREFIX/../cctools-toolchain/bin:$PATH
Check it:
gcc -v
© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有