Re: Adding a file to libgomp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 23, 2011, at 12:16 AM, Ian Lance Taylor wrote:

> Amittai Aviram <amittai.aviram@xxxxxxxx> writes:
> 
>> On Nov 22, 2011, at 8:21 PM, Ian Lance Taylor wrote:
>> 
>>> Amittai Aviram <amittai.aviram@xxxxxxxx> writes:
>>> 
>>>> I am creating a modified version of GCC's libgomp library, which involves a few additional files.  I've already added three successfully, but now I have to add a fourth, and I cannot remember the correct procedure.  I tried adding the name of the file to the list of *.c files called libgomp_la_SOURCES in Makefile.am (line 34 in my GCC release), and then went to my build directory (which is a sibling to my gcc source's root directory), and entered
>>>> 
>>>> ../configure --prefix=<my_install_directory_path>
>>>> make -j
>>>> make -j install
>>>> 
>>>> But, when I looked at gcc_obj/x86_64-unknown-linux-gnu, I found no reference to the new file, and an objdump disassembly confirms that the new code is not there.  
>>>> 
>>>> What is the correct way to add a file to the libgomp build?  Thanks!
>>> 
>>> After modifying Makefile.am you need to run automake in order to get a
>>> new Makefile.in.
>>> 
>>> Ian
>> 
>> Thanks!  But I just noticed this in the Automake manual:
>> 
>> "When you later change some instructions in a Makefile.am or configure.ac, the relevant part of the build system will be regenerated automatically when you execute make."
>> 
>> That's at 
>> http://www.gnu.org/software/automake/manual/automake.html#Introduction
>> 
>> Is it obsolete?
> 
> It's optional, and gcc doesn't use it.  Specifically, the presence of
> AM_MAINTAINER_MODE in libgomp/configure.ac means that automake is only
> run automatically if you configure with --enable-maintainer-mode.  This
> is a feature, not a bug.
> 
> Ian

OK, I've run automake so as to create a new Makefile.in.  Before this, I had to do several things:

1.  I added my new file's name to the "libgomp_la_SOURCES" list.
2.  I changed the value of the definition of _GCC_AUTOCONF_VERSION from 2.64 to 2.65.  (Otherwise, automake fails and complains that aclocal.ac was made with autoconf version 2.64.)
3.  I ran reconfigure.  (Otherwise, automake still fails, with an error message suggesting that you run reconfigure.)

Finally, I ran automake, and got a Makefile.in file, which had my new file listed alongside the other files in the places where I would have expected it to occur.

I then cd'd to my build directory, configured, and built:

~/gcc $ cd ../gcc_obj
~/gcc_obj $ ../gcc/configure --prefix=/<myhomedir>/gcc_install
...
~/make -j && make -j install

However, after all that, the name of the function defined in my new file does not occur in the compiled library code, as I discovered by using nm libgomp | grep "my_new_function" .

Is there something else I'm supposed to do between running automake and building the project with configure, make, and make install?

Thanks!


Amittai Aviram
PhD Student in Computer Science
Yale University
646 483 2639
amittai.aviram@xxxxxxxx
http://www.amittai.com




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux