[Home]

Summary:ASTERISK-15422: [patch] LD (llinker) options not used by main/ and channels/ builds
Reporter:Philip Prindeville (pprindeville)Labels:
Date Opened:2010-01-13 13:39:22.000-0600Date Closed:2010-02-09 08:15:23.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk-1.6-astldflags.patch
Description:The top-level makefile passes $(ASTLDFLAGS) which is user-specified and $(_ASTLDFLAGS) which is system-generated to the subdirs main/ and channels/ when they are built.  Unfortunately, the makefiles in these directories don't use them.

If building in an environment that requires additional flags for correctness (e.g. when building against multiple versions of the same libraries), this may cause linkage against the wrong libraries (in this case, the system default libraries would be used) which would result in incorrect binaries being built.

Since the binaries are somewhat likely to succeed (with the default libraries), this would result in incorrect test results when doing software validation (since the desired libraries would not have been used, and hence not tested).
Comments:By: Philip Prindeville (pprindeville) 2010-01-13 13:44:06.000-0600

This is the simplest fix I could come up with in terms of lines changes and proving correctness.

However, a better strategy might have been to do the following in the top-level Makefile:

ifeq ($(OSARCH),OpenBSD)
  SOLINK=-shared -fpic
endif
+
+_ASTCFLAGS+=$(ASTCFLAGS)
+_ASTLDFLAGS+=$(ASTLDFLAGS)

# comment to print directories during submakes
#PRINT_DIR=yes

and just made use of $(_ASTLDFLAGS) in all cases, and never used $(ASTLDFLAGS) directly, either in the top-level makefile or in the subdirs' makefiles.

By: Leif Madsen (lmadsen) 2010-01-13 13:46:24.000-0600

Marking as Confirmed as we have a patch submitted which may resolve the issue, but is not necessary the most ideal way to resolve this. To be reviewed by another developer. Thanks for the submission!

By: Kevin P. Fleming (kpfleming) 2010-01-14 03:32:37.000-0600

The SVN trunk Makefiles already have proper support for this usage, so if this is going to be changed in 1.6.2 it should be done by backporting the trunk changes.

By: Tilghman Lesher (tilghman) 2010-02-08 16:04:59.000-0600

kpfleming:  while that appears to be true for _ASTCFLAGS, I don't see that it is solved for _ASTLDFLAGS.  Looks like that flag was simply missed for the main and channels directories (in trunk), as reported.

By: Digium Subversion (svnbot) 2010-02-08 16:31:41.000-0600

Repository: asterisk
Revision: 245578

U   trunk/channels/Makefile
U   trunk/main/Makefile

------------------------------------------------------------------------
r245578 | tilghman | 2010-02-08 16:31:41 -0600 (Mon, 08 Feb 2010) | 12 lines

Actually use _ASTLDFLAGS in the main/ and channels/ Makefiles.

They were previously passed correctly, but they simply weren't used.  This
caused issues with various platforms whose builds needed to pass special
linker flags via the configure script.

(closes issue ASTERISK-15422)
Reported by: pprindeville
Patches:
      asterisk-1.6-astldflags.patch uploaded by pprindeville (license 347)
Tested by: tilghman

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=245578

By: Digium Subversion (svnbot) 2010-02-08 16:46:22.000-0600

Repository: asterisk
Revision: 245579

_U  branches/1.6.0/
U   branches/1.6.0/channels/Makefile
U   branches/1.6.0/main/Makefile

------------------------------------------------------------------------
r245579 | tilghman | 2010-02-08 16:46:22 -0600 (Mon, 08 Feb 2010) | 19 lines

Merged revisions 245578 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r245578 | tilghman | 2010-02-08 16:31:40 -0600 (Mon, 08 Feb 2010) | 12 lines
 
 Actually use _ASTLDFLAGS in the main/ and channels/ Makefiles.
 
 They were previously passed correctly, but they simply weren't used.  This
 caused issues with various platforms whose builds needed to pass special
 linker flags via the configure script.
 
 (closes issue ASTERISK-15422)
  Reported by: pprindeville
  Patches:
        asterisk-1.6-astldflags.patch uploaded by pprindeville (license 347)
  Tested by: tilghman
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=245579

By: Digium Subversion (svnbot) 2010-02-08 16:46:37.000-0600

Repository: asterisk
Revision: 245580

_U  branches/1.6.1/
U   branches/1.6.1/channels/Makefile
U   branches/1.6.1/main/Makefile

------------------------------------------------------------------------
r245580 | tilghman | 2010-02-08 16:46:36 -0600 (Mon, 08 Feb 2010) | 19 lines

Merged revisions 245578 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r245578 | tilghman | 2010-02-08 16:31:40 -0600 (Mon, 08 Feb 2010) | 12 lines
 
 Actually use _ASTLDFLAGS in the main/ and channels/ Makefiles.
 
 They were previously passed correctly, but they simply weren't used.  This
 caused issues with various platforms whose builds needed to pass special
 linker flags via the configure script.
 
 (closes issue ASTERISK-15422)
  Reported by: pprindeville
  Patches:
        asterisk-1.6-astldflags.patch uploaded by pprindeville (license 347)
  Tested by: tilghman
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=245580

By: Digium Subversion (svnbot) 2010-02-08 16:46:48.000-0600

Repository: asterisk
Revision: 245581

_U  branches/1.6.2/
U   branches/1.6.2/channels/Makefile
U   branches/1.6.2/main/Makefile

------------------------------------------------------------------------
r245581 | tilghman | 2010-02-08 16:46:48 -0600 (Mon, 08 Feb 2010) | 19 lines

Merged revisions 245578 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r245578 | tilghman | 2010-02-08 16:31:40 -0600 (Mon, 08 Feb 2010) | 12 lines
 
 Actually use _ASTLDFLAGS in the main/ and channels/ Makefiles.
 
 They were previously passed correctly, but they simply weren't used.  This
 caused issues with various platforms whose builds needed to pass special
 linker flags via the configure script.
 
 (closes issue ASTERISK-15422)
  Reported by: pprindeville
  Patches:
        asterisk-1.6-astldflags.patch uploaded by pprindeville (license 347)
  Tested by: tilghman
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=245581