bugThe FreeType Project - Bugs: bug #17029, Macro from libtool not expanded?

 
 

bug #17029: Macro from libtool not expanded?

Submitted by:  Peter Dyballa <ballapete>
Submitted on:  Tue 04 Jul 2006 10:54:47 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: suzuki toshiya <mpsuzuki>Open/Closed: Closed
Planned Release: 2.3.0

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 06 Oct 2006 09:16:23 PM UTC, comment #16:

I patched freetype2/builds/unix/unix-cc.in and it created a prebound libfreetype!

Thank you for this!

In the xcb case with the unresolved ${wl} macro in X11R7.1 I found that it's only due to a faulty PATH setting. Due to this tools from Fink and tools from Apple/Xcode were used:

/usr/bin/autoconf --version => autoconf (GNU Autoconf) 2.59
/usr/bin/automake --version => automake (GNU automake) 1.6.3
/usr/bin/glibtoolize --version => libtoolize (GNU libtool) 1.5
/usr/bin/aclocal --version => aclocal (GNU automake) 1.6.3

/sw/bin/pkg-config --version => 0.21
/sw/bin/libtoolize --version => libtoolize (GNU libtool) 1.5.22
/sw/bin/automake --version => automake (GNU automake) 1.9.6
/sw/bin/autoconf --version => autoconf (GNU Autoconf) 2.60
/sw/bin/aclocal --version => aclocal (GNU automake) 1.9.6

Apple only provides a glibtoolize.

Pete

Anonymous
Thu 05 Oct 2006 04:23:19 PM UTC, comment #15:

Yes, this issue is not freetype2 specific,
same issue occurs in other softwares too.
In the case of freetype2, following change of freetype2/builds/unix/unix-cc.in
http://cvs.savannah.nongnu.org/viewcvs/freetype2/builds/unix/unix-cc.in?root=freetype&r1=1.14&r2=1.15
will fix the problem.
In freetype-2.2.2, setting LD_PREBIND will be
sufficient to build prebound Mach dylib.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Wed 04 Oct 2006 10:57:32 PM UTC, comment #14:

I've found the same behaviour with a part of X11R7.1, xcb, when I was using libtool 1.5.22 from Fink's odcctools 590-20060608, Darwin cctools build system/code base to support gcc4 (https://bugs.freedesktop.org/show_bug.cgi?id=8504)

Can this all happen because in Mac OS X 10.3 and 10.4 /bin/sh is indeed /bin/bash? I tried to re-build xcb with a different PATH setting, in which /usr/bin came before /sw/lib/odcctools/bin, but Apple's libtool makes the same mistake.

Anonymous
Thu 17 Aug 2006 02:35:43 AM UTC, comment #13:

I've checked latest CVS for next libtool-1.5.x (1.5.23a),
${wl} issue occurs.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Thu 17 Aug 2006 01:38:53 AM UTC, comment #12:

> Anyway, although "${wl}" is expanded, prebinding is disturbed by -undefined flag,
>the built DYLIB is not prebounded.
>I have to check this is bug of libtool or FreeType2's building system.


Sorry, it is my mistake: libtool.m4 refers environment variable
MACOSX_DEPLOYMENT_TARGET which is configured by
Xcode (and yet I've never run it). By setting it as 10.3 or 10.4,
I could build prebound dylib.

vanilla libtool-2.1a: OK
vanilla libtool-1.5.22: '${wl}' issue occurs
vanilla libtool-1.4.3: OK, but prebinding is not supported

I will continue libtool investigation.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Tue 15 Aug 2006 08:21:14 PM UTC, comment #11:

Sorry for lated response.

The reason why "${wl}" is expanded after patching
to configure.ac is: autogen.sh overwrites libtool
by new system (or Fink) libtool. I've checked
vanilla libtool-1.4.3, libtool-1.5.22 and
libtool-2.1a. The un-expansion problem of "${wl}"
(when LD_PREBIND is used) occurs in libtool-1.5.22 only.
Anyway, although "${wl}" is expanded, prebinding
is disturbed by -undefined flag, the built DYLIB
is not prebounded. I have to check this is bug of
libtool or FreeType2's building system.

BTW, about the reason why Fink does not enable old
mac font support and use their own patch: although
I've never contacted with Fink's FT2 package maintainer,
I guess as following: Until freetype-2.1.10, old
mac font support was disabled by default, and Fink
provided FT2 without it, there is no serious requirement
to support old mac font. In fact, I receive a few
unexpected behaviour of old mac font via GTK+ list,
so, possibly "MacOS system font is not supported,
at all" might be the simplest solution to save
the font newbies from confusion.
Although I'm not sure whether Fink people are such
serious, there can be another political reason:
Fink is not only for Mac OS X. It was originally
designed for both of Darwin and Mac OS X. Nothing
to say, Darwin has no ToolBox, QuickDraw FontManager,
ATS. To support both system with single binary,
--with-old-mac-fonts should be switched off.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Wed 02 Aug 2006 10:33:45 AM UTC, comment #10:

Interesting!

After applying your patch I just invoked

./configure

I see no ld warnings, and "otool -hv /Users/pete/Quellen/freetype-2.2.1/objs/.libs/libfreetype.6.3.10.dylib" tells me:

/Users/pete/Quellen/freetype-2.2.1/objs/.libs/libfreetype.6.3.10.dylib:
Mach header
magic cputype cpusubtype filetype ncmds sizeofcmds flags
MH_MAGIC PPC ALL DYLIB 11 1324 NOUNDEFS DYLDLINK PREBOUND TWOLEVEL

When I do

./configure --with-old-mac-fonts

I see again no ld warnings and otool tells me:

/Users/pete/Quellen/freetype-2.2.1/objs/.libs/libfreetype.6.3.10.dylib:
Mach header
magic cputype cpusubtype filetype ncmds sizeofcmds flags
MH_MAGIC PPC ALL DYLIB 13 1536 NOUNDEFS DYLDLINK PREBOUND TWOLEVEL

In my LDFLAGS I have -dead_strip.

(Do you know why the Fink people have their own patch and do not like --with-old-mac-fonts? Making their libfreetype.6.3.10.dylib gives a Fink specific ld warning: -dylib_install_name /sw/lib/freetype22/lib/libfreetype.6.dylib not found in segment address table LD_SEG_ADDR_TABLE /sw/var/lib/fink/prebound/seg_addr_table)

Peter Dyballa <ballapete>
Wed 02 Aug 2006 03:08:02 AM UTC, comment #9:

OK, I could reproduce the problem out of Emacs.
The method by LD_PREBIND is noted in:
http://developer.apple.com/releasenotes/DeveloperTools/Prebinding.html
So it is more official than Myth's method.

$ env LD_PREBIND="" ./configure --with-old-mac-fonts
$ env LD_PREBIND="" make
...
gcc -dynamiclib ${wl}-flat_namespace ${wl}-undefined ${wl}suppress \
-o /Users/mpsuzuki/freetype-2.2.1/objs/.libs/libfreetype.6.3.10.dylib \
... \
-lz \
-Wl,-framework -Wl,CoreServices \
-Wl,-framework -Wl,ApplicationServices \
-install_name /usr/local/lib/libfreetype.6.dylib \
-Wl,-compatibility_version -Wl,10 -Wl,-current_version -Wl,10.10
ld: warning -undefined suppress disables -prebind

As reported, "${wl}" macro is not expanded, and prebinding is failed.
I will check more in detail.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Tue 01 Aug 2006 10:47:05 PM UTC, comment #8:

Sorry, I was a bit lazy, too. I had some quarrels with Emacsen.

I usually have LD_PREBIND set. The usual ld behaviour is to create prebound libraries without extra effort, but it does not always happen so (due to two level name space?).

After I can use autoconf 2.60 it has to be configured --with-old-mac-fonts to create a prebound library. Indeed!

Your patch changes from

checking the maximum length of command line arguments... 196608
to
checking the maximum length of command line arguments... 65536

but in the end otool -hv tells me that objs/.libs/libfreetype.6.3.10.dylib is prebound!

I still see that strange line:

gcc -dynamiclib ${wl}-undefined ${wl}dynamic_lookup -o .../freetype-2.2.1/objs/.libs/libfreetype.6.3.10.dylib .../freetype-2.2.1/objs/.libs/ftsystem.o ... -lz -install_name /usr/local/lib/libfreetype.6.dylib -Wl,-compatibility_version -Wl,10 -Wl,-current_version -Wl,10.10

Peter Dyballa <ballapete>
Tue 01 Aug 2006 08:11:41 PM UTC, comment #7:

Fink provides me now with autoconf 2.60. The FreeType2 builds/unix/libtool is version 1.5.22. Still I see in the compilation buffer of GNU Emacs obviously unexpanded macros:

./builds/unix/libtool --mode=link gcc -o ....
gcc -dynamiclib ${wl}-undefined ${wl}dynamic_lookup -o ...
(cd .../freetype-2.2.1/objs/.libs && rm -f libfreetype.6.dylib && ln -s libfreetype.6.3.10.dylib libfreetype.6.dylib)

Anonymous
Mon 31 Jul 2006 09:45:17 AM UTC, comment #6:

# Werner, please remind the "statically-bounded shared library" of
# ancient SysV, DEC OSF/1 and AIX.

Sorry, I have no idea you are talking about...
Shall I do something?

Werner LEMBERG <wl>
Project Administrator
Mon 31 Jul 2006 01:38:22 AM UTC, comment #5:

Sorry for long lated reply. I'm MacOS maintainer of FreeType2.

To build FreeType2 with prebind option, the instructions at
http://www.mythtv.org/wiki/index.php/Myth_on_Mac_OS_X:

> ./configure --disable-static
> make LDFLAGS="-no-undefined -Wl,-prebind,-seg1addr,0xC0000000 -lz"

is enough, I think. Peter, if your method is different,
please give me more detailed information to reproduce the problem you found.

Unfortunately, builds/unix/configure in FreeType-2.2 has small bug for MacOSX:
you have to add "--with-old-mac-fonts" manually (--without or
--with..=no does not works), or please apply attached patch, or
use latest CVS version (2.2.1 is not Intel-ready, so I recommend to
use CVS version).
If build as "./configure && make ..." , you will receive errors/warnings
saying some CoreFoundation functions are missing. This is because
Mac OS X's prebinding requires explicit notification of all dependent
libraries to bind symbols to fixed VM address.

# Werner, please remind the "statically-bounded shared library" of
# ancient SysV, DEC OSF/1 and AIX.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Wed 05 Jul 2006 10:51:38 AM UTC, comment #4:

In my Fink based development department I already have libtool 1.5.22, but autoconf is at 2.59! I'll have to wait until it's upgraded to 2.60. If I'll get told that this will take more than one or two weeks I'll consider to upgrade "locally."

Peter Dyballa <ballapete>
Wed 05 Jul 2006 10:02:57 AM UTC, comment #3:

Aah, you mean you get unexpanded values, right?

Please try to rebuild the autoconf script with the latest
versions of libtool (1.5.22) and autoconf (2.60). The
version of automake (which contains `aclocal') is not
significant, I think. There's a good chance that things
have improved for Mac OS X. To do that it should be
sufficient to run the `autogen.sh' script.

If it still fails please provide a log output for further
investigation and reopen this bug.

Regarding the behaviour of -Wl I can't believe that gcc
works differently on Mac OS X. First of all, it would be
a serious hindrance w.r.t. portability, and secondly, since
gcc acts as a frontend to the linker only in this case, it
should be rather trivial to concatenate multiple -Wl options
into a single one. If you really see this behaviour I urge
you to send a bug report to the gcc maintainers!

Werner LEMBERG <wl>
Project Administrator
Wed 05 Jul 2006 08:06:53 AM UTC, comment #2:

That a command starting with

gcc -dynamiclib ${wl}-undefined ${wl}dynamic_lookup -o ...

is executed to create the dynamic Freetype2 libraries. As the title reminds.

The additional text was kind of a hint to think of adapting different "gcc dialects." At least on Mac OS X it is a bit different, and the situation seems to become more complex since Apple supports now Intel based hardware and Universal Binaries.

Peter Dyballa <ballapete>
Wed 05 Jul 2006 05:47:46 AM UTC, comment #1:

Hmm.

`info gcc' says

`-Wl,OPTION'
Pass OPTION as an option to the linker. If OPTION contains
commas, it is split into multiple options at the commas.

that is what we explicitly do. And here an example from
`info libtool':

gcc -g -O -o .libs/test test.o -Wl,--rpath
-Wl,/usr/local/lib /usr/local/lib/libhello.a -lm

Thus I think FreeType does it right.

What's your complaint?

Werner LEMBERG <wl>
Project Administrator
Tue 04 Jul 2006 10:54:47 PM UTC, original submission:

Trying to compile freetype 2.2.1 on Mac OS X 10.4.7 and trying to make the library prebound.

builds/unix/libtool has defined

# How to pass a linker flag through the compiler.
wl="-Wl,"

but the final call to create the shared library has:

gcc -dynamiclib ${wl}-undefined ${wl}dynamic_lookup -o ...

as cited from compilation buffer in GNU Emacs. Although I think that the gcc options should be

gcc -dynamic -Wl,-undefined,dynamic_lookup -Wl,-prebind

(The manual explains: If the compiler driver cc(1) is used to invoke ld , it maybe necessary to pass the ld(1) options to cc(1) using -Wl,-option,argument1,argument2.)

Peter Dyballa <ballapete>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #10441:  freetype-2.2.1_macosx-config.patch.bz2 added by mpsuzuki (87KiB - application/x-bzip2 - patch to fix builds/unix/configure for Mac OS X.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 11 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 05 Oct 2006 04:23:19 PM UTCmpsuzukiStatusNeed Info=>Fixed
  Open/ClosedOpen=>Closed
Mon 31 Jul 2006 01:38:22 AM UTCmpsuzukiStatusInvalid=>Need Info
  Assigned towl=>mpsuzuki
  Open/ClosedClosed=>Open
  Planned ReleaseNone=>2.3.0
  Attached File-=>Added freetype-2.2.1_macosx-config.patch.bz2, #10441
Wed 05 Jul 2006 10:04:34 AM UTCwlCarbon-Copy-=>Added mpsuzuki
Wed 05 Jul 2006 05:47:46 AM UTCwlStatusNone=>Invalid
  Assigned toNone=>wl
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1