Bug #42721 configure.in invokes 'nm' directly
Submitted: 10 Feb 2009 7:47 Modified: 17 Jul 2009 3:16
Reporter: Philip Prindeville Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1.31 OS:Linux
Assigned to: Christoffer Hall
Triage: Triaged: D3 (Medium)

[10 Feb 2009 7:47] Philip Prindeville
Description:
The sequence:

if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
then
  tmp=`nm /usr/lib*/libc.a  | grep _nss_files_getaliasent_r`
  if test -n "$tmp"
  then
     STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
     STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
     static_nss=1
  fi
fi

invokes 'nm' directly instead of $NM.  It also assumes libc is in /usr/lib*/libc.a and ignores any value $other_libc_lib might contain.

How to repeat:
Build in a cross-compilation environment.

Suggested fix:
Patch as:

if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
then
  tmp=`$NM ${other_libc_lib:-/usr/lib*}/libc.a  | grep _nss_files_getaliasent_r`
  if test -n "$tmp"
  then
     STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
     STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
     static_nss=1
  fi
fi
[10 Feb 2009 17:07] Sergei Golubchik
I wonder if we could remove static nss code altogether.
[10 Feb 2009 19:18] Sveta Smirnova
Thank you for the report.

Verified as described.
[19 Jun 2009 13:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/76692

2963 Christoffer Hall	2009-06-19
      BUG#42721 configure.in invokes 'nm' directly
      
      A hardcoded use of nm and libc was put into configure.in. This broke cross-compiling and is bad practice. Fitting variables now used.
[22 Jun 2009 12:46] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/76829

2963 Christoffer Hall	2009-06-22
      BUG#42721 configure.in invokes 'nm' directly
      
      A hardcoded use of nm and libc was put into configure.in. This broke
      cross-compiling and is bad practice. Fitting variables now used.
[8 Jul 2009 13:30] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source revid:satya.bn@sun.com-20090629130819-akeyqcnuagsyc2sh) (merge vers: 5.1.37) (pib:11)
[9 Jul 2009 7:37] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source revid:satya.bn@sun.com-20090629130819-akeyqcnuagsyc2sh) (merge vers: 5.1.37) (pib:11)
[10 Jul 2009 11:21] Bugs System
Pushed into 5.4.4-alpha (revid:anozdrin@bk-internal.mysql.com-20090710111017-bnh2cau84ug1hvei) (version source revid:hall@mysql.com-20090629133510-f6omuz9zw2n7j3k8) (merge vers: 5.4.4-alpha) (pib:11)
[17 Jul 2009 3:16] Paul Dubois
Noted in 5.1.37, 5.4.4 changelogs.

configure.in contained references to literal instances of nm and
libc, rather than to variables parameterized for the proper values on
the current platform.
[12 Aug 2009 22:42] Paul Dubois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[15 Aug 2009 2:01] Paul Dubois
Ignore previous comment about 5.4.2.
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:33] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[8 Oct 2009 2:50] Paul Dubois
The 5.4 fix has been pushed to 5.4.2.