bugGNU Astronomy Utilities - Bugs: bug #52674, Correcting extra linking warnings...


You are not allowed to post comments on this tracker with your current authentication level.

bug #52674: Correcting extra linking warnings during compilation

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Fri 15 Dec 2017 04:55:48 PM UTC
Category:  Installation Severity:  3 - Normal
Item Group:  Addition(s) Status:  Fixed
Privacy:  Public Assigned to:  makhlaghi
Open/Closed:  Closed

Jump to the original submission

Mon 22 Jan 2024 10:51:19 AM UTC, comment #6: 

Thanks a lot Raul! This warning has been fixed in Commit 4904eb5d8.

Since neither of the issues are happening any more, I am closing this bug. Thanks a lot also to Thorsten for the reminder on this bug.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 22 Jan 2024 09:45:32 AM UTC, comment #5: 

Yes! No warnings related to this are printed. There is only one that you can see below.

eps.c:879:29: warning: implicit conversion from 'double' to 'long' changes value from 0.1 to 0 [-Wliteral-conversion]
1 warning generated.

Raul Infante-Sainz <infantesainz>
Group Member
Mon 22 Jan 2024 09:25:34 AM UTC, comment #4: 

Thanks a lot Raul! The main warnings are expected to be in the output of 'make'. Can you continue the build with 'make' and 'make check' and see if any warnings are printed?

Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 22 Jan 2024 08:42:17 AM UTC, comment #3: 

I just checked the './configure' step using Gnuastro 0.21.70-5005 on a macOS Monterey 12.3 (Apple M1 chip). Below are the lines containing the string 'pthread'. I think the problem has been fixed. Let me know if you need any further check.

checking for pthread.h... yes
checking whether pthreads work with "-pthread" and "-lpthread"... yes
checking whether Clang needs flag to prevent "argument unused" warning when linking with -pthread... no
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for pthread_barrier_wait in -lpthread... no
checking for pthread_sigmask... yes
checking for pthread.h... (cached) yes
checking for pthread_kill in -lpthread... yes
checking for pthread_t... yes
checking for pthread_spinlock_t... no
checking for pthread_rwlock_t... yes
checking whether pthread_rwlock_rdlock prefers a writer to a reader... yes
checking whether pthread_create exists as a global function... yes
checking whether pthread_sigmask is a macro... no
checking whether pthread_sigmask returns error numbers... yes
checking whether pthread_sigmask unblocks signals correctly... guessing yes
checking for pthread_atfork... yes

Raul Infante-Sainz <infantesainz>
Group Member
Sun 21 Jan 2024 07:40:13 PM UTC, comment #2: 

Indeed, the warnings only show on the macOS; I don't see any on the Clang of Arch GNU/Linux now either (version 16.0.6).

I will ask a friend with a macOS to try a recent build and see if the warning is still reported there.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Tue 16 Jan 2024 06:22:33 PM UTC, comment #1: 

Is this just an issue on MacOS? Using the tools on Debian Bookworm (clang-14). I don't see two '-pthread' options. I do see something like '-pthread -lpthead' but this does not show any other warnings.

Also I don't see the ld warnings that a directory was not found.

Thorsten Alteholz <alteholz>
Group Member
Fri 15 Dec 2017 04:55:48 PM UTC, original submission:  

When linking the libraries, currently Gnuastro uses the `-pthread' option two times! This can lead to the following linking warning on some systems (this is from Mac OS X):

clang: \cf4 warning: \cf2 argument unused during compilation: '-pthread' [-Wunused-command-line-argument]\

Another strange source of linker warning is that the two directories `../lib' and `../../lib' are used with `-L' for both programs and the library. However, only the first is necessary for the library and the second is necessary for the programs. On the system above, we get this linker warning (first when finalizing the libraries, the second after each program):

ld: warning: directory not found for option '-L../../lib'
ld: warning: directory not found for option '-L../lib'

I can't figure out why it is doing this!?! In `configure.ac', we only add `$(top_builddir)/lib' to `LDFLAGS'!

It would be cleaner if we correct these warnings.

In particular, the second one may be a security issue: Since when building the libraries, it will first look into `../../lib' (outside of Gnuastro) and someone can put a bad library there to link against.

Mohammad Akhlaghi <makhlaghi>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by infantesainz (Posted a comment)
  • -email is unavailable- added by alteholz (Posted a comment)
  • -email is unavailable- added by makhlaghi (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-22 makhlaghi StatusPostponed Fixed
        Assigned toNone makhlaghi
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code