bugGNU nano - Bugs: bug #38378, nano links against libmagic, but...

 
 

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

bug #38378: nano links against libmagic, but libmagic needs libz and the build fails

Submitter:  Alan Hourihane <alanh>
Submitted:  Fri 22 Feb 2013 04:05:51 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Mon 16 Jun 2014 03:29:06 PM UTC, comment #5: 

Fixed in SVN, r4967.  Thanks for reporting.

Benno Schulenberg <bens>
Group administrator
Mon 16 Jun 2014 09:50:58 AM UTC, comment #4: 

Yep, that works. Thanks.

Alan Hourihane <alanh>
Sun 15 Jun 2014 08:49:11 PM UTC, comment #3: 

Okay, with the attached patch the -lz flag gets added to the final linking stage of the compilation.  Could you please test if this prevents the build failure on your system?

(I cannot test myself.  When I tried, by moving /lib/libz* out of the way, everything stopped working: autoconf, ./configure, gcc...  I begin to understand why one would want to have a statically linked system.  :)  Luckily mv still worked.)

(file #31557)

Benno Schulenberg <bens>
Group administrator
Sat 14 Jun 2014 09:04:39 PM UTC, comment #2: 

I think this line ....

AC_CHECK_LIB(libz, deflate)

should be....

AC_CHECK_LIB(z, deflate)

Alan Hourihane <alanh>
Sat 14 Jun 2014 08:23:23 PM UTC, comment #1: 

Okay.  But how should I check for the presence of libz?  If I add the following to configure.ac:

AS_IF([test "x$enable_libmagic" != "xno"], [
  AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
  AC_CHECK_LIB(libz, deflate)
])

I get this from ./configure:

checking for library containing zlibVersion... none required
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for deflate in -llibz... no

Is the AC_SEARCH_LIBS enough?  Does it not matter that, even though zlib is present, none of its functions are detectable by ./configure?

Benno Schulenberg <bens>
Group administrator
Fri 22 Feb 2013 04:05:51 PM UTC, original submission:  

I'm on a static only system, where there are no shared libraries.

libmagic.so on a shared system implicitly links libz, but nano doesn't check that.

On a static only system nano needs to link libz as well as libmagic otherwise the build fails.

Alan Hourihane <alanh>

 

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

Attached Files
file #31557:  adding-lz.patch added by bens (398B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by alanh (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-06-16 bens StatusNone Fixed
        Assigned toNone bens
        Open/ClosedOpen Closed
    2014-06-15 bens Attached File- Added adding-lz.patch, #31557

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code