xattrs patch for tar-1.23 version(GNU tar) - attributes

xattrs patch for tar-1.23 version(GNU tar).
I am working on a project which requires xattr support(along with capabilities)of GNU tar-1.23 version.I am unable to get these extended attributes by GNU tar 1.23(from opensource www.gnu.org package).I found that fedora and centos GNU tar-1.23 version has option --with-xattrs ,I am new to this ,so please help me to resolve this problem in tar-1.23 version.Please provide me the patch file for tar-1.23 supports xattrs or the source from which I can get the same.
Thanks in advance

Related

How to link mach-o format object files on linux?

I have been attempting to link a MACHO formatted object file on Linux, but I have failed miserably. So far, I have created the object file by running:
nasm -fmacho -o machoh.o hello.o
I have tried linking using:
clang --target=x86_64-apple-darwin machoh.o
but that failed. I have attempted using GCC, LD, and other linkers but I have still failed miserably. Are there any ideas on how I could solve my problem?
Thank you very much.
The most accessible solution would be lld, the LLVM linker.
lld does not ship with clang, but is a separate package.
sudo apt install lld
If you installed a version of clang that isn't the default (e.g. clang-12 explicitly), then you should use the same version for lld (i.e. lld-12).
Get a MacOS SDK from somewhere. This GitHub repo archives them.
If you're uncomfortable using the above, the "legitimate" way of obtaining it without a Mac would be:
Create an Apple ID
Go to https://developer.apple.com/download/all/
Download the "Command Line Tools for Xcode <version>"
Mount or extract the dmg
Extract the XAR package
For each ".pkg" folder inside, run pbzx <Payload | cpio -i
Find the Library/Developer/CommandLineTools/SDKs/MacOSX.sdk inside.
Feed both of the above to clang:
clang --target=x86_64-apple-darwin -fuse-ld=lld --sysroot=path/to/MacOSX.sdk machoh.o
I have tried linking using: clang --target=x86_64-apple-darwin machoh.o
but that failed.
Failed how? Details matter.
Anyway, there are 3 commonly used linkers on Linux: BFD-ld, Gold, and (newest) LLD.
Of these, Gold is an ELF-only linker, and will not work for Mach-O.
BFD-ld is only configured to support a few emulations (use ld --help to see which ones) in my distribution. BFD does appear to support Mach-O, so it's probably possible to build a Linux BFD-ld cross-linker with such support.
LLD should support Mach-O out of the box, but you are probably not using LLD.
So your first step should be to figure out which linker clang --target=x86_64-apple-darwin ... uses, and then make it use the one which does support Mach-O.

Updating the Compiler for the GPS Community Edition 2019 IDE

I've recently started working on a project that requires my complier to be above GNAT 4.8.5 - When I go to: Help > About
You can see that the version I'm using is 4.8.5
Also, when I run the gnatls -v command, I can see this...
[parallels#localhost ~]$ gnatls -v
GNATLS 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 1997-2013, Free Software Foundation, Inc.
Source Search Path:
<Current_Directory>
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/adainclude/
Object Search Path:
<Current_Directory>
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/adalib/
Project Search Path:
<Current_Directory>
/usr/x86_64-redhat-linux/lib/gnat
/usr/share/gpr
/usr/lib/gnat
[parallels#localhost ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++,ada
Thread model: posix
gcc version 7.3.0 (GCC)
[parallels#localhost ~]$
Please could someone be able to tell me how to update my GNAT compiler? Also, I'm using the Centos 7 Operating System.
Thank you,
Lloyd
You don't need to install a compiler, you already have 3 (at least):
gcc 4.8.5 (the system compiler) in /usr/bin
gcc 7.3.0 (that you just built) in /usr/local/bin
gcc 8.3.1 (from GNAT CE 2019) in /home/parallels/opt/GNAT/2019/bin
Your PATH determines which GCC you pick up when you say just gcc, and which GNATLS you pick up when you say just gnatls, .. etc.
According to a previous post, your PATH is:
$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/var/lib/snapd/snap/bin:/home/parallels/.local/bin:/home/parallels/bin/home/parallels/opt/GNAT/2019/bin/home/parallels/opt/GNAT/2019/bin
so when you say just gcc the system looks at the first entry in the PATH (which is colon-separated) and .. there it is! so it executes that.
If you'd built your 7.3.0 GCC with Ada support, it would have found gnatls in the same place. I have a very strong suspicion that you didn't, so when you say just gnatls the system looks in /usr/local/bin - no luck - then in /usr/local/sbin - no luck - then in /usr/bin - whoopee! but that's the 4.8.5 GCC that you don't want.
Looking again at your PATH, the last part is mangled - you've added /home/parallels/bin and /home/parallels/opt/GNAT/2019/bin (twice) without including the colon separators, resulting in a nonexistent path. (/home/parallels/bin may well have been added by the system - I assume that /home/parallels is your home directory).
What you need to do is to make sure that you pick up the compiler that came with GNAT CE 2019 by putting its location first in your PATH. One way of doing this is by editing your shell startup files.
I don't know how CENTOS sets accounts up, and I don't know what your shell is. Assuming it's bash (type ps -p $$, should come back with bash or perhaps -bash; anything else, I can't help), you need to edit one of the shell startup files - I'm a little unclear about this, but I think it'll be ~/.bashrc (~ is shorthand for your home directory); see here for the gory details. Find the last mention of PATH and immediately after that line insert
export PATH=/home/parallels/opt/GNAT/2019/bin:$PATH
Open a new terminal window and say e.g. gnatls -v - you should pick up the GNAT CE 2019 one.
Only way I know of updating GNAT GPS CE from AdaCore is downloading the new one, installing it and then deleting the old one.
Another thing is to upgrade the gnat-gps that some systems had in ther repositories

Optimal way to install clang locally when GCC is outdated

I need to use tools that depend on clang on a Unix machine I remote onto at work. Anything I install is locally installed onto ~/local. I do not have root permissions.
/usr is pretty outdated, with gcc being at version 4.4.7. clang requires gcc 4.7+
I read on linux from scratch that a gcc 6.1 installation requires 8.4 gb. This is not something I can do, because that's huge.
Can someone advise me on the best workaround to install up to date clang on my ~/local?
Please and thanks.
Edit:
Courtesy of Nishant, here is the short answer:
Set up a personal machine running the same linux distro and cross compile using gcc to your specific architecture. For me, I will run a Redhat 6.5 VM and compile using gcc an arm x64 binary. Thanks Nishant!
You can get pre-build binaries for Unix system from LLVM's release website: http://llvm.org/releases/
You can then put the binaries in any local folder you want and source it using the PATH variable, which can be done by modifying your ~/.bashrc file by appending:
export PATH=$PATH:<clang-binary-directory>
Now you will able to use clang from the command line terminal as if it was installed.
If you want to build from source only, you can get older source code of clang which will use gcc 4.4.7 and build it and then use clang to build clang. Or get the latest clang binary and use it to build latest clang.

automake version (am__api_version) hardcoded in configure script

I'm currently working on a Linux project using autotools. The code is submitted in SCM (Perforce) and we have the configure script, Makefile.am, Makefile.in - the usual autotools boilerplate. Recently, somebody has changed Makefile.am, but forgot to regenerate Makefile.in; when I tried to build, I got this error:
WARNING: `automake-1.11' is missing on your system. You should only need it if
you modified `Makefile.am', `acinclude.m4' or `configure.ac'.
You might want to install the `Automake' and `Perl' packages.
Grab them from any GNU archive site.
cd . && /bin/bash ./config.status Makefile depfiles
I see the automake version is hardcoded in the configure script (and seems to come from aclocal.m4):
am__api_version='1.11'
So I guess I need automake-1.11 (not 1.10, not anything newer) to regenerate the Makefile.in file.
Why is that? Why should we be tied to a specific automake version? We're mostly building on Ubuntu 14.04, where 1.14 is the default version installed. Is there a way to tell the build system to simply use whatever version of automake is installed? Or is it safe to maybe remove the am__api_version definition from aclocal.m4?
The problem is that you are trying to recreate Makefile.in with other version of autotools. It would lead to version mismatch as aclocal.m4 was built with different version and it is used to generate the remaining files.
Instead of recreating only Makefile.in, try to also recreate aclocal.m4 and all remaining autotools generated files:
autoreconf --force --install
The important question is why would someone fix am__api_versions.
The most probable answer is: Because automake tends to alter the macro's arguments or even remove entirely macros of previous release. In each release announcement of automake there is a section called
WARNING: Future backward-incompatibilities!
and an other one called
Obsolete features removed
You can refer to releases 1.12, 1.13, 1.14
So the configure.ac or Makefile.am might contain some macros which have become obsolete in later releases. When encountering this problem you have two possibilities. Either find out which feature replaced the obsolete one or stick to one version of automake. Most developers do not feel that autotools files are part of the projects source code. They just wish to keep the working version running and stick to the current am version.
Note that all distributions support older versions of automake. In ubuntu you can find:
$ apt-cache search automake | grep automake
automake - Tool for generating GNU Standards-compliant Makefiles
automake1.4 - A tool for generating GNU Standards-compliant Makefiles
automake1.9 - A tool for generating GNU Standards-compliant Makefiles
automake1.10 - Tool for generating GNU Standards-compliant Makefiles
automake1.11 - Tool for generating GNU Standards-compliant Makefiles
Meaning that you can install the requested version of automake.
So, you could remove the line am__api_version='1.11' and find out which macro is obsolete. Then you will have to decide which of the above two solutions you will follow.

cross compiling using ELDK-5.3, openssl in eldk 5.3, openssl/crypto.h not found

While executing make it shows openssl/crypto.h not found, does
eldk-5.3 have openssl support. I found only gnutls in it.
How to enable/install openssl support in ELDK-5.3
Meanwhile it was there in eldk4.2.
Please advise on it ?
crypto.h is the part of openssl-devel RPM. So instead of copy header file manually you can install this RPM to eldk toolchain. It will fix all the dependency crypto.h header file as well.
I just copied it from eldk4.2 and wow it worked!
Still curious to know about eldk-5.3.
cp -Rfp /opt/eldk4.2/arm/usr/include/openssl /opt/eldk-5.3/armv5te/sysroots/armv5te-linux-gnueabi/usr/include/

Resources