ASL 2.0 Beta 6 bugs discussion

In another post KE7MT mentioned he saw the following compile errors with this latest beta 6:

/home/repeater/ASL-Asterisk/asterisk/main/utils.c:1390: undefined reference to `pthread_setspecific’
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:142: asterisk] Error 1
make[1]: Leaving directory ‘/home/repeater/ASL-Asterisk/asterisk/main’
make: *** [Makefile:361: main] Error 2

I have confirmed that I get the same errors (numerous warnings about ‘pthread_setspecific’ being undefined) on my RPi4, which I set up a couple months ago using the latest 2.0 beta at that time, which had no compile issues.

KE7MT and I did the following steps to get the repo and do the make, resulting in the above errors:

git clone https://github.com/AllStarLink/ASL-Asterisk.git
cd ASL-Asterisk/asterisk
./configure
make
sudo make install

I then confirmed that the older Beta (from Nov. 17 with added PR) compiles and installs fine, with the following steps:

mkdir ASL-PR34-20221117
cd ASL-PR34-20221117
git init
git remote add origin https://github.com/davidgsd/ASL-Asterisk.git
git fetch origin 24cdbdc0b235122a8cd8502a5bf7f749ba9c1c9b
git reset --hard FETCH_HEAD
cd asterisk
./configure
make
sudo make install

David’s fork seems to have been branched off of commit 695e60db55, so most likely the changes you are looking for are between that, and the tip of develop, which is at c0270959.

The errors look like config errors, so to me the most likely commit to affect that would be commit 795ba8ef " uodate config.guess and config.sub". Would you be able to test building that commit?

git clone https://github.com/AllStarLink/ASL-Asterisk.git ASL-20221125
git checkout 795ba8ef0a28b54c4cd49862ced4db4d14d60a2a
cd ASL-20221125/asterisk
./configure
make

I’m guessing your architecture is armhf. I don’t have access at this moment to a node with that architecture to test this myself. My node OS is aarch64, and things build just fine on it.

Another thing you might try is checking if the configuration step has different output for pthreads at each of those commits. For example

./configure | grep pthreads

My x86_64 machine gives

checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking if more special flags are required for pthreads... no

My aarch64 machine gives

checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking if more special flags are required for pthreads... no

It would be interesting to know if you are getting different configuration results on your node when you checkout the different commits.

Commit 795ba8ef gives the same compile errors on my RPi4 as the latest develop code. And BTW it does compile fine on my Dell 3040 (Intel Atom).

Result of ASL-20221125/asterisk$ ./configure | grep pthreads

checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking if more special flags are required for pthreads... no
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found

I attached the resulting error messages during make:
x.pdf (24.4 KB)

I was able to get a PI3 and put the ASL beta image on it to reproduce the error. As I thought, the config.guess script is outputting a slightly different architecture for native builds now. I think the maintainers didn’t see this because they are cross-compiling.
For commit 6914538 the config.guess script outputs armv7l-unknown-linux-gnueabi
For commit 795ba8e the config.guess script outputs armv7l-unknown-linux-gnueabihf
This trips up the Makefile that links the main asterisk executable so that it is missing some of the library flags for the linker, including -lpthread.
I’ve created a pull request here: Fix linker library flags for native armhf builds of asterisk by encbar5 · Pull Request #41 · AllStarLink/ASL-Asterisk · GitHub

Thanks for the fix. Compiles fine now on my RPi4. I did the following to pull the code and make:

git clone https://github.com/AllStarLink/ASL-Asterisk.git ASL-20221229
cd ASL-20221229
git pull origin pull/41/head
cd asterisk
./configure
make

Thanks,
David