how to check for shared library dependancies in petalinux - embedded-linux

I have successfully cross compiled a sample application for Zynq Zedboard using arm-linux-gnueabi. I am running petalinux on it. However running the application xiSample gives the following error:
./xiSample: error while loading shared libraries: /usr/lib/libm3api.so.2: internal error
Further, ls -l on /usr/lib/ gives:
root#xiAPI:/usr/lib# ls -l
lrwxrwxrwx 1 root root 42 Mar 13 2018 ld-linux-
armhf.so.3 -> /usr/arm-linux-gnueabihf/lib/sf/ld-2.23.so
-rwxr-xr-x 1 root root 45556 Mar 13 2018 libjbig.so.2
-rwxr-xr-x 1 root root 15284 Mar 13 2018
libjbig85.so.2.0
-rwxr-xr-x 1 root root 222748 Mar 13 2018 libjpeg.so.8
-rwxr-xr-x 1 root root 222748 Mar 13 2018
libjpeg.so.8.1.2
-rwxr-xr-x 1 root root 193248 Mar 13 2018 liblzma.so.5
-rwxr-xr-x 1 root root 193248 Mar 13 2018
liblzma.so.5.2.3
lrwxrwxrwx 1 root root 13 Jan 1 00:54 libm3api.so -
> libm3api.so.2
lrwxrwxrwx 1 root root 17 Jan 1 00:58 libm3api.so.0
-> libm3api.so.0.0.0
-rwxr-xr-x 1 root root 19850208 Jan 1 00:54
libm3api.so.0.0.0
lrwxrwxrwx 1 root root 17 Jan 1 00:58 libm3api.so.2
-> libm3api.so.2.0.0
-rwxr-xr-x 1 root root 23453232 Jan 1 00:54
libm3api.so.2.0.0
-rwxr-xr-x 1 root root 441068 Mar 13 2018 libtiff.so.5
-rwxr-xr-x 1 root root 441068 Mar 13 2018
libtiff.so.5.3.0
-rwxr-xr-x 1 root root 9760 Mar 13 2018
libtiffxx.so.5
-rwxr-xr-x 1 root root 9760 Mar 13 2018
libtiffxx.so.5.3.0
-rwxr-xr-x 1 root root 106100 Mar 13 2018 libz.so.1
-rwxr-xr-x 1 root root 106100 Mar 13 2018
libz.so.1.2.11
lrwxrwxrwx 1 root root 18 Jan 1 00:56 m3api ->
/opt/XIMEA/include
drwxr-xr-x 3 root root 4096 Feb 22 2018 opkg
How can I find the shared libraries my executable needs, as petalinux does not contain ldd or file.
EDIT: I am having trouble further isolating error. Any suggestion on what might be causing this? I think it is a linking error.

In Petalinux environment, this is what you can do:
readelf -d xiSample | grep NEEDED
This will list the required dynamic dependencies.
A similar answer here: https://unix.stackexchange.com/questions/120015/how-to-find-out-the-dynamic-libraries-executables-loads-when-run

Related

/lib/x86_64-linux-gnu/libm.so.6: undefined reference to `__strtof128_nan#GLIBC_PRIVATE'

I use catkin_make to compile a ros project, but it failed.
it shows that there are some problems when linking the library.
[ 98%] Linking CXX executable /home/kyxz2021/fleet/devel/lib/data_parser/data_parser_node
/lib/x86_64-linux-gnu/libm.so.6: undefined reference to `__strtof128_nan#GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status
i searched the error, someone said it might due to the inconsistency between libm version and libc version, but it is not the knot here.
***#ubuntu:~$ ll /lib/x86_64-linux-gnu/libm.so.6
lrwxrwxrwx 1 root root 12 May 16 20:52 /lib/x86_64-linux-gnu/libm.so.6 -> libm-2.23.so
***#ubuntu:~$ ll /lib/x86_64-linux-gnu/libc*
-rwxr-xr-x 1 root root 1868984 Jun 5 2020 /lib/x86_64-linux-gnu/libc-2.23.so*
lrwxrwxrwx 1 root root 14 Feb 11 2016 /lib/x86_64-linux-gnu/libcap.so.2 -> libcap.so.2.24
-rw-r--r-- 1 root root 23128 Oct 23 2015 /lib/x86_64-linux-gnu/libcap.so.2.24
lrwxrwxrwx 1 root root 21 Feb 11 2016 /lib/x86_64-linux-gnu/libcgmanager.so.0 -> libcgmanager.so.0.0.0
-rw-r--r-- 1 root root 141248 Jan 18 2016 /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0
-rw-r--r-- 1 root root 190856 Jun 5 2020 /lib/x86_64-linux-gnu/libcidn-2.23.so
lrwxrwxrwx 1 root root 15 Jun 5 2020 /lib/x86_64-linux-gnu/libcidn.so.1 -> libcidn-2.23.so
lrwxrwxrwx 1 root root 17 Jan 22 2020 /lib/x86_64-linux-gnu/libcom_err.so.2 -> libcom_err.so.2.1
-rw-r--r-- 1 root root 14648 Jan 22 2020 /lib/x86_64-linux-gnu/libcom_err.so.2.1
-rw-r--r-- 1 root root 39224 Jun 5 2020 /lib/x86_64-linux-gnu/libcrypt-2.23.so
-rw-r--r-- 1 root root 2366112 Feb 17 10:21 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
lrwxrwxrwx 1 root root 22 Feb 11 2016 /lib/x86_64-linux-gnu/libcryptsetup.so.4 -> libcryptsetup.so.4.6.0
-rw-r--r-- 1 root root 158920 Sep 6 2017 /lib/x86_64-linux-gnu/libcryptsetup.so.4.6.0
lrwxrwxrwx 1 root root 16 Jun 5 2020 /lib/x86_64-linux-gnu/libcrypt.so.1 -> libcrypt-2.23.so
lrwxrwxrwx 1 root root 12 Jun 5 2020 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.23.so*
And the output of nm -AD /lib/x86_64-linux-gnu/lib{c,m}-2.23.so | grep __strtof128_nan is shown below.
***#ubuntu:~$ nm -AD /lib/x86_64-linux-gnu/lib{c,m}-2.23.so | grep __strtof128_nan
/lib/x86_64-linux-gnu/libm-2.23.so: U __strtof128_nan
i don't know how to solve the problem, i'd be appreciated if someone could help me.
This particular error seems to be from not having float128 support (aka quadmath). Check that your gcc version and libraries are new enough and have the right links. Since it's not a compile but linking error, perhaps you need to link against -lquadmath. But also, since your error msg seems to show the compilation target as custom code, do you need to be using quadmath?

"/etc/sudoers is world writable” on Mac OS Mojave

I have gone through a lot of google results. Let me explain what I have tried first. I am currently working on a corporate laptop. Mac OS Mojave 10.14.6.
Error that I get:
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
ls -le /etc
-rwxrwxrwx 1 root wheel 179 Aug 18 2018 shells
drwxrwxrwx 4 root wheel 128 Aug 18 2018 snmp
drwxrwxrwx 5 root wheel 160 Nov 11 2019 ssh
drwxrwxrwx 6 root wheel 192 Nov 11 2019 ssl
-rwxrwxrwx 1 root wheel 257 Aug 18 2018 sudo_lecture
-rwxrwxrwx 1 root wheel 1630 Mar 11 11:51 sudoers
drwxrwxrwx 2 root wheel 64 Aug 18 2018 sudoers.d
drwxrwxrwx 4 root admin 128 Dec 25 2018 symantec
-rw-rw-rw-# 1 01244861 wheel 47 Feb 2 18:13 sysctl.conf
-rwxrwxrwx 1 root wheel 96 Aug 21 2018 syslog.conf
-rwxrwxrwx 1 root wheel 1316 Aug 18 2018 ttys
drwxrwxrwx 6 root wheel 192 Aug 18 2018 wfs
-rwxrwxrwx 1 root wheel 0 Aug 18 2018 xtab
-rwxrwxrwx 1 root wheel 126 Aug 18 2018 zprofile
-rwxrwxrwx 1 root wheel 207 Aug 18 2018 zshrc
I have changed permission using chmod 440 /etc/sudoers and chmod 777 /etc/sudoers and also using info and manually updating from the file properties.
I am using iTerm2 as my terminal.
echo $PATH
/Users/01244861/.yarn/bin:/Users/01244861/.nvm/versions/node/v10.13.0/bin:/usr/local/opt/node#10/bin:/usr/local/opt/node#10/bin:/usr/local/opt/node#10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/go/bin
echo $SHELL
/bin/zsh
My user permissions:
Is there anything else that I can do to fix this?
Thanks

Go lang doing some terraform testing modules from up and running book

Just going thru a terraform book and testing go code. I can run simple Go fine but when I'm trying to use the terratest module with some real basic Go code I am getting this error. Tried changing symlinks to other ld listed in the /usr/bin/. Any help is appreciated. Elementary OS 5.1.
# runtime/cgo
collect2: fatal error: cannot find 'ld'
compilation terminated.
(base) XXXXX#XXXX-Latitude-E6540:/usr/bin$ ls -la *ld
-rwxr-xr-x 1 root root 1382 May 10 2018 dh_auto_build
-rwxr-xr-x 1 root root 35000 Jan 18 2018 fold
lrwxrwxrwx 1 root root 21 Jun 18 2020 gold -> x86_64-linux-gnu-gold
lrwxrwxrwx 1 root root 19 Dec 22 16:52 ld -> x86_64-linux-gnu-ld
lrwxrwxrwx 1 root root 24 Jun 18 2020 ld.gold -> x86_64-linux-gnu-ld.gold
lrwxrwxrwx 1 root root 26 Mar 26 2018 pybuild -> ../share/dh-python/pybuild
lrwxrwxrwx 1 root root 36 Feb 5 2018 swipl-ld -> ../lib/swi-prolog/bin/amd64/swipl-ld
lrwxrwxrwx 1 root root 24 Jun 18 2020 x86_64-linux-gnu-gold -> x86_64-linux-gnu- ld.gold
lrwxrwxrwx 1 root root 23 Jun 18 2020 x86_64-linux-gnu-ld -> x86_64-linux-gnu-ld.bfd
-rwxr-xr-x 1 root root 3111952 Jun 18 2020 x86_64-linux-gnu-ld.gold
lrwxrwxrwx 1 root root 26 Jun 18 2020 x86_64-linux-gnux32-ld -> x86_64-linux-gnux32-ld.bfd
-rwxr-xr-x 1 root root 3111952 Jun 18 2020 x86_64-linux-gnux32-ld.gold
Go test code:
package test
import (
"github.com/gruntwork-io/terratest/modules/terraform"
"testing"
)
func TestAlbExample (t *testing.T) {
opts := &terraform.Options{
TerraformDir: "/home/XXXX/terraform/aws/examples/alb",
}
}
I decided this maybe coming from my conda installation as it does have some shared binaries in the "go env". I removed it and bingo. So if you have this problem definitely look there.

Apache will not deliver resources in sub directories of /var/www/html

I currently have a server running Ubuntu 18.04 with Apache2. I am not able to access png's and svg files in sub directories. Example: /var/www/html/icons/new.svg when the page is located in /var/www/html/index.php. However, Apache will deliver images from within the page directory so all photos within /var/www/html will be delivered.
The error code for the images is just a plain 404. I am able to access pages within /var/www/html/sub/index.php. All images are using relative links if that matters.
I do have a non verified ssl on my server but even on plain http it doesn't deliver if that matters.
It's probably a dumb question but thanks for your time anyways.
All Code worked on a local wamp server before being put on a lamp server.
Example Code:
<img src="icons/new.svg"> <!--Wont work-->
<img src="logo.svg"> <!--Will Work-->
Inside /var/www/html
drwxr-xr-x 6 root root 4096 Jun 26 18:04 .
drwxr-xr-x 3 root root 4096 Jun 22 18:55 ..
drwxr-xr-x 4 root root 4096 Jun 26 17:50 icons
-rw-r--r-- 1 root root 4340 Jun 26 18:11 index.php
-rw-r--r-- 1 root root 4172 Jun 26 18:11 logo.svg
-rw-r--r-- 1 root root 1856 Jun 26 18:11 mainstyle.css
drwxr-xr-x 2 root root 4096 Jun 26 17:50 PHP
drwxr-xr-x 2 root root 4096 Jun 26 17:50 plandetails
drwxr-xr-x 2 root root 4096 Jun 26 17:50 planicons
-rw-r--r-- 1 root root 295915 Jun 26 18:11 searchbkg.jpg
-rw-r--r-- 1 root root 7366 Jun 26 18:11 searchbkg.svg
Inside the icons folder
drwxr-xr-x 4 root root 4096 Jun 26 17:50 .
drwxr-xr-x 6 root root 4096 Jun 26 18:04 ..
-rw-r--r-- 1 root root 446 Jun 26 18:37 arrowleft.svg
-rw-r--r-- 1 root root 446 Jun 26 18:37 arrowrt.svg
-rw-r--r-- 1 root root 7863 Jun 26 18:37 bestoffer.svg
-rw-r--r-- 1 root root 4024 Jun 26 18:37 free.svg
-rw-r--r-- 1 root root 477 Jun 26 18:37 informationbubble.svg
-rw-r--r-- 1 root root 3404 Jun 26 18:37 new.svg
drwxr-xr-x 2 root root 4096 Jun 26 17:50 plans
drwxr-xr-x 2 root root 4096 Jun 26 17:50 prices
-rw-r--r-- 1 root root 2272 Jun 26 18:37 save.svg
Updated /var/www/html perms
drwxr-xr-x 6 root root 4096 Jun 26 18:04 .
drwxr-xr-x 3 root root 4096 Jun 22 18:55 ..
drwxr-xr-x 4 root root 4096 Jun 26 17:50 icons
-rw-r--r-- 1 root root 4340 Jun 26 18:37 index.php
-rw-r--r-- 1 root root 4172 Jun 26 18:37 logo.svg
-rw-r--r-- 1 root root 1856 Jun 26 18:37 mainstyle.css
drwxr-xr-x 2 root root 4096 Jun 26 17:50 PHP
drwxr-xr-x 2 root root 4096 Jun 26 17:50 plandetails
drwxr-xr-x 2 root root 4096 Jun 26 17:50 planicons
-rw-r--r-- 1 root root 295915 Jun 26 18:37 searchbkg.jpg
-rw-r--r-- 1 root root 7366 Jun 26 18:37 searchbkg.svg
For anyone wondering I used the combination of the help below and this
This is not a php question, this is an apache question and is a matter of permissions, try:
chmod a+rx /var/www/html/sub/
and
chmod a+r /var/www/html/*
EDIT:
Your Virtual Host should be:
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>

Invalid active developer path on MAC OS X after installing Ruby

I get this error:
xcrun: error: invalid active developer path (/Applications/Xcode.app), missing xcrun at: /Applications/Xcode.app/usr/bin/xcrun
This solution works, but the error occurs again after closing my terminal and reopening it; I then have to run the same commands every time I open a new terminal window.
How can I apply these changes such that they will save after closing the terminal window out?
I started getting the same error after updating to OS X El Capitan.
In my case, all I did was to install it:
sudo xcode-select --install
And it works fine for me.
The steps below are for OS X 10.10 (Yosemite). Those experiencing this because of an upgrade to 10.11 (El Capitan) seem need to only run sudo xcode-select --install as described in the accepted answer.
I found a suggestion here which indicated
sudo xcode-select -switch /
as the fix. However, this threw an error that the developer path was invalid.
Instead, for me, I modified this to
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
(which is a mixture of the two referenced link solutions) and this worked.
Try using
xcode-select --print-path
to find your developer path if /Applications/Xcode.app/Contents/Developer/ is still invalid for you.
I know this is quite old but I got the same issue and then I fixed it by doing couple more extra steps. Problem came when Terminal could not find the actual path of the Command Line Tools.
If you had Xcode and then removed it, then Terminal is referring to
the Command Line Tools inside the Xcode folder. Try using this
command and check what your path is, xcode-select --print-path. This would most likely print /Applications/Xcode.app/Contents/Developer.
Now to fix this, reinstall the command line tools for xcode. Initially remove any previous installations using sudo rm -rf /Library/Developer/CommandLineTools.
Then install the command line tools sudo xcode-select --install
Now the final step, change the path for the CLT to the actual path using sudo xcode-select -switch /Library/Developer/CommandLineTools/ this will fix it.
I resolved the issue with the below steps.
Xcode -> Preferences -> Locations -> Command Line Tools -> Select the command tool matching your Xcode version.
I started getting the same error after i update macOS Mojave to macOS Catalina.
I just installed few command lines in Terminal,
$ sudo gem install cocoapods
$ sudo xcode-select --install
$ chsh -s /bin/zsh
Then, goto Xcode -> Preferences -> Locations -> Command Line Tools and confirm you have current Xcode version selected there.
For me the solution was as easy as reinstalling Xcode.
It was pointed out here: https://superuser.com/a/981126
You can (re)install Xcode via command line like the answer above suggest, or directly from the App Store.
I too had the same issue after upgrading to OS X EI Captian. I just installed xcode-select using sudo xcode-select --install
sudo xcode-select -switch / works for me.
Partial diagnosis: https://github.com/microsoft/vcpkg/issues/8781#issuecomment-547248760
It seems that upgrading from one MacOS version to another either uninstalls some dev tools or it moves them to another path, and this breaks compatibility with any tool using the environment variable that points to the old location where the tools were located.
sudo xcode-select --install
Using the install command worked for me, but it is not clear whether this simply downloaded and unpacked files and then skipped installation and simply updated an environment variable or whether it physically installed the files at the expected path. (Or it could have made links to the new folder path).
Testing my theory, I probe the folder structure with ls (I should have done this before using the install command):
rej#Ryans-MacBook-Air:~$ ls /Library/Developer/CommandLineTools/usr/bin/
rej#Ryans-MacBook-Air:~$ ls -la /Library/Developer/CommandLineTools/usr/bin/
total 243776
drwxr-xr-x 124 root wheel 3.9K Oct 28 23:03 ./
drwxr-xr-x 7 root admin 224B Oct 28 23:05 ../
lrwxr-xr-x 1 root wheel 64B Oct 28 23:03 2to3# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/2to3
lrwxr-xr-x 1 root wheel 68B Oct 28 23:03 2to3-3.7# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/2to3-3.7
-rwxr-xr-x 1 root wheel 116K Sep 5 22:51 DeRez*
-rwxr-xr-x 1 root wheel 31K Sep 5 22:51 GetFileInfo*
-rwxr-xr-x 1 root wheel 33K Sep 5 22:51 ResMerger*
-rwxr-xr-x 1 root wheel 126K Sep 5 22:51 Rez*
-rwxr-xr-x 1 root wheel 31K Sep 5 22:51 SetFile*
-rwxr-xr-x 1 root wheel 32K Sep 5 22:51 SplitForks*
-rwxr-xr-x 1 root wheel 41K Sep 5 22:51 ar*
-rwxr-xr-x 1 root wheel 40K Sep 5 22:51 as*
-rwxr-xr-x 1 root wheel 27K Sep 5 22:51 asa*
-rwxr-xr-x 1 root wheel 216K Sep 5 22:51 bison*
-rwxr-xr-x 1 root wheel 159K Sep 5 22:51 bitcode_strip*
lrwxr-xr-x 1 root wheel 5B Oct 28 23:03 c++# -> clang
-rwxr-xr-x 1 root admin 31K Sep 5 22:51 c89*
-rwxr-xr-x 1 root admin 31K Sep 5 22:51 c99*
lrwxr-xr-x 1 root wheel 5B Oct 28 23:03 cc# -> clang
-rwxr-xr-x 1 root wheel 80M Sep 5 22:51 clang*
lrwxr-xr-x 1 root wheel 5B Oct 28 23:03 clang++# -> clang
-rwxr-xr-x 1 root wheel 125K Sep 5 22:51 cmpdylib*
-rwxr-xr-x 1 root wheel 154K Sep 5 22:51 codesign_allocate*
lrwxr-xr-x 1 root wheel 17B Oct 28 23:03 codesign_allocate-p# -> codesign_allocate
-rwxr-xr-x 1 root admin 3.3K Aug 16 06:55 cpp*
-rwxr-xr-x 1 root wheel 36K Sep 5 22:51 ctags*
-rwxr-xr-x 1 root wheel 150K Sep 5 22:51 ctf_insert*
-rwxr-xr-x 1 root wheel 30M Sep 5 22:51 dsymutil*
lrwxr-xr-x 1 root wheel 14B Oct 28 23:03 dwarfdump# -> llvm-dwarfdump
-rwxr-xr-x 1 root wheel 477K Sep 5 22:51 dwarfdump-classic*
-rwxr-xr-x 1 root wheel 211K Sep 5 22:51 dyldinfo*
-rwxr-xr-x 1 root wheel 239B Sep 5 19:18 easy_install-3.7*
-rwxr-xr-x 1 root wheel 572K Sep 5 22:51 flex*
-rwxr-xr-x 1 root wheel 572K Sep 5 22:51 flex++*
lrwxr-xr-x 1 root wheel 3B Oct 28 23:03 g++# -> gcc
-rwxr-xr-x 1 root wheel 101K Aug 16 07:31 gatherheaderdoc*
-rwxr-xr-x 1 root admin 27K Sep 5 22:51 gcc*
lrwxr-xr-x 1 root wheel 8B Oct 28 23:03 gcov# -> llvm-cov
-rwxr-xr-x 1 root wheel 2.4M Sep 5 22:51 git*
lrwxr-xr-x 1 root wheel 3B Oct 28 23:03 git-receive-pack# -> git
-rwxr-xr-x 1 root wheel 1.4M Sep 5 22:51 git-shell*
lrwxr-xr-x 1 root wheel 3B Oct 28 23:03 git-upload-archive# -> git
lrwxr-xr-x 1 root wheel 3B Oct 28 23:03 git-upload-pack# -> git
-rwxr-xr-x 1 root wheel 148K Sep 5 22:51 gm4*
-rwxr-xr-x 1 root wheel 166K Sep 5 22:51 gnumake*
-rwxr-xr-x 1 root wheel 98K Sep 5 22:51 gperf*
-rwxr-xr-x 1 root wheel 33K Sep 5 22:51 hdxml2manxml*
-rwxr-xr-x 1 root wheel 158K Aug 16 07:31 headerdoc2html*
-rwxr-xr-x 1 root wheel 73K Sep 5 22:51 indent*
-rwxr-xr-x 1 root wheel 142K Sep 5 22:51 install_name_tool*
-rwxr-xr-x 1 root wheel 2.5M Sep 5 22:51 ld*
-rwxr-xr-x 1 root wheel 230B Aug 16 07:13 lex*
-rwxr-xr-x 1 root wheel 163K Sep 5 22:51 libtool*
-rwxr-xr-x 1 root wheel 73K Sep 5 22:51 lipo*
-rwxr-xr-x 1 root wheel 332K Sep 5 22:51 lldb*
-rwxr-xr-x 1 root wheel 3.6M Sep 5 22:51 llvm-cov*
-rwxr-xr-x 1 root wheel 7.9M Sep 5 22:51 llvm-dwarfdump*
-rwxr-xr-x 1 root wheel 9.8M Sep 5 22:51 llvm-nm*
-rwxr-xr-x 1 root wheel 11M Sep 5 22:51 llvm-objdump*
-rwxr-xr-x 1 root wheel 40K Sep 5 22:51 llvm-otool*
-rwxr-xr-x 1 root wheel 1.6M Sep 5 22:51 llvm-profdata*
-rwxr-xr-x 1 root wheel 2.9M Sep 5 22:51 llvm-size*
-rwxr-xr-x 1 root wheel 3.5K Aug 16 07:19 lorder*
-rwxr-xr-x 1 root wheel 148K Sep 5 22:51 m4*
-rwxr-xr-x 1 root wheel 166K Sep 5 22:51 make*
-rwxr-xr-x 1 root wheel 7.7K Aug 16 07:16 mig*
lrwxr-xr-x 1 root wheel 7B Oct 28 23:03 nm# -> llvm-nm
-rwxr-xr-x 1 root wheel 142K Sep 5 22:51 nm-classic*
-rwxr-xr-x 1 root wheel 171K Sep 5 22:51 nmedit*
lrwxr-xr-x 1 root wheel 12B Oct 28 23:03 objdump# -> llvm-objdump
lrwxr-xr-x 1 root wheel 10B Oct 28 23:03 otool# -> llvm-otool
-rwxr-xr-x 1 root wheel 644K Sep 5 22:51 otool-classic*
-rwxr-xr-x 1 root wheel 138K Sep 5 22:51 pagestuff*
-rwxr-xr-x 1 root wheel 221B Sep 5 19:18 pip3*
-rwxr-xr-x 1 root wheel 221B Sep 5 19:18 pip3.7*
-rwxr-xr-x 1 root wheel 32K Sep 5 22:51 projectInfo*
lrwxr-xr-x 1 root wheel 66B Oct 28 23:03 pydoc3# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/pydoc3
lrwxr-xr-x 1 root wheel 68B Oct 28 23:03 pydoc3.7# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/pydoc3.7
lrwxr-xr-x 1 root wheel 67B Oct 28 23:03 python3# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/python3
lrwxr-xr-x 1 root wheel 74B Oct 28 23:03 python3-config# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/python3-config
lrwxr-xr-x 1 root wheel 69B Oct 28 23:03 python3.7# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/python3.7
lrwxr-xr-x 1 root wheel 76B Oct 28 23:03 python3.7-config# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/python3.7-config
lrwxr-xr-x 1 root wheel 70B Oct 28 23:03 python3.7m# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/python3.7m
lrwxr-xr-x 1 root wheel 77B Oct 28 23:03 python3.7m-config# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/python3.7m-config
lrwxr-xr-x 1 root wheel 66B Oct 28 23:03 pyvenv# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/pyvenv
lrwxr-xr-x 1 root wheel 70B Oct 28 23:03 pyvenv-3.7# -> ../../Library/Frameworks/Python3.framework/Versions/3.7/bin/pyvenv-3.7
lrwxr-xr-x 1 root wheel 7B Oct 28 23:03 ranlib# -> libtool
-rwxr-xr-x 1 root wheel 70K Sep 5 22:51 resolveLinks*
-rwxr-xr-x 1 root wheel 85K Sep 5 22:51 rpcgen*
-rwxr-xr-x 1 root wheel 56K Sep 5 22:51 segedit*
lrwxr-xr-x 1 root wheel 12B Oct 28 23:03 size# -> size-classic
-rwxr-xr-x 1 root wheel 125K Sep 5 22:51 size-classic*
-rwxr-xr-x 1 root admin 138K Sep 5 22:51 stapler*
-rwxr-xr-x 1 root wheel 126K Sep 5 22:51 strings*
-rwxr-xr-x 1 root wheel 179K Sep 5 22:51 strip*
-rwxr-xr-x 1 root wheel 330K Sep 5 22:51 svn*
-rwxr-xr-x 1 root wheel 118K Sep 5 22:51 svnadmin*
-rwxr-xr-x 1 root wheel 105K Sep 5 22:51 svnbench*
-rwxr-xr-x 1 root wheel 64K Sep 5 22:51 svndumpfilter*
-rwxr-xr-x 1 root wheel 71K Sep 5 22:51 svnfsfs*
-rwxr-xr-x 1 root wheel 98K Sep 5 22:51 svnlook*
-rwxr-xr-x 1 root wheel 70K Sep 5 22:51 svnmucc*
-rwxr-xr-x 1 root wheel 89K Sep 5 22:51 svnrdump*
-rwxr-xr-x 1 root wheel 122K Sep 5 22:51 svnserve*
-rwxr-xr-x 1 root wheel 90K Sep 5 22:51 svnsync*
-rwxr-xr-x 1 root wheel 44K Sep 5 22:51 svnversion*
-rwxr-xr-x 1 root wheel 90M Sep 5 22:51 swift*
lrwxr-xr-x 1 root wheel 5B Oct 28 23:03 swift-autolink-extract# -> swift
-rwxr-xr-x 1 root admin 6.1M Sep 5 22:51 swift-build*
-rwxr-xr-x 1 root admin 734K Sep 5 22:51 swift-build-tool*
-rwxr-xr-x 1 root wheel 687K Sep 5 22:51 swift-demangle*
lrwxr-xr-x 1 root wheel 5B Oct 28 23:03 swift-format# -> swift
-rwxr-xr-x 1 root admin 6.1M Sep 5 22:51 swift-package*
-rwxr-xr-x 1 root admin 6.1M Sep 5 22:51 swift-run*
-rwxr-xr-x 1 root wheel 61K Sep 5 22:51 swift-stdlib-tool*
-rwxr-xr-x 1 root admin 6.1M Sep 5 22:51 swift-test*
lrwxr-xr-x 1 root wheel 5B Oct 28 23:03 swiftc# -> swift
-rwxr-xr-x 1 root wheel 12M Sep 5 22:51 tapi*
-rwxr-xr-x 1 root wheel 41K Sep 5 22:51 unifdef*
-rwxr-xr-x 1 root wheel 2.9K Aug 16 07:19 unifdefall*
-rwxr-xr-x 1 root wheel 63K Sep 5 22:51 unwinddump*
-rwxr-xr-x 1 root wheel 49K Sep 5 22:51 vtool*
-rwxr-xr-x 1 root wheel 45K Sep 5 22:51 xml2man*
-rwxr-xr-x 1 root wheel 135B Aug 16 07:22 yacc*
It is apparent that the files are physically located at that folder location and the installer installed missing components. The fact that MacOS's upgrade process uninstalls my development environment is unfriendly and Apple should be reprimanded.
I had faced the same issue when i removed one of the two Xcode installed.
I have solve this issue by Switching the path using terminal like below
$ sudo xcode-select --switch (drag Xcode here to get a path)
e.g sudo xcode-select --switch /Applications/Xcode\ 10.1.app
I got a similar error running Homebrew for the first time after upgrading from macOS Mojave v10.14 to Catalina v10.15.
It's never a good idea to run commands without understanding what's wrong with your installation of Homebrew and what the commands actually do. Your first and best option is to run brew doctor. This command will not only tell you if something is wrong but also how to fix the problem. In my case it showed:
Warning: Your Xcode is configured with an invalid path.
You should change it to the correct path:
sudo xcode-select -switch /Applications/Xcode.app
Once you fix the problem(s), run brew doctor again. Basically, repeat the process until you get the all clear message.
In some cases, you get something like:
Unbrewed dylibs/header files/static libraries were found in /usr/local/....
This will happen if you've installed software outside Homebrew that also use the same location to store their files. In many cases, it's safe to ignore these warnings.

Resources