<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000000"><div data-marker="__QUOTED_TEXT__"><div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:10pt;color:#000000"><div>Hi Y.HB<br></div><br><div>LDFLAGS sets both the library kind to include in the archive build but it also uses the -L flags to know where to look for it. The -lm can mean the libm.a. libm.so libm.la so it searches the LD_LIBRARY_PATH environment variable to find one that fits. If you want expressly to include the libm.a you should specify it instead of -lm. The first thing I recommend is find the symbols inside the Makefile configured for the .  Look for the LDFLAGS and then your LD_LIBRARY_PATH to see if it matches where that arm-rtems5/lib/libm.a is.<br></div><br><div>You can even use the flag argument:  arm-rtems5/lib/libm.a or ./arm-rtems5/lib/libm.a to express the precise library and location to use. <br></div><br><div>This is one important distinction that many people confuse about how automake and autoconf work: There is no "internal logic" in the autotools way of creating recipes for Makefiles. m4 is used for pattern processing. You must express what you want it to make, it won't go looking anywhere else than what is specified. <br></div><br><div>It's not cmake, scons, or raw make. GNU Autotools creates recipe files, like config.status, that just hold environmental variables.<br></div><br><div>DaemonDave on github.<br></div><br><hr id="zwchr"><div><b>From: </b>"Y. HB" <sprhawk@gmail.com><br><b>To: </b>"rtems-users@rtems.org" <users@rtems.org><br><b>Sent: </b>Friday, July 22, 2022 12:11:38 AM<br><b>Subject: </b>Re: How can I add LDFLAGS for bsp build?<br></div><br><div><div dir="ltr"><div>I added -lm in LDFLAGS in my custom bsps/arm/tms570/config/xxx.cfg</div><br><div>the flag is added to compiling arguments, but it still reported undefined reference to 'floor', but I see there is floor symbols in the arm-rtems5/lib/libm.a</div><br><div>Why is it?</div><br><div>Thanks<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 22, 2022 at 1:43 PM Y. HB <<a href="mailto:sprhawk@gmail.com" rel="nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">sprhawk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb( 204 , 204 , 204 );padding-left:1ex"><div dir="ltr"><div>Hello</div><br><div>I'm working on a custom tms570 bsp upon RTEMS 5.1, but it depends on math lib (-lm), how can I add this flag to the bsp build?</div><br><div>Shall I add LDFLAGS="-lm" during configure or shall I change some variables in c/src/lib/libbsp/arm/xxxx/Makefile.am?</div><br><div>Thanks<br></div></div>
</blockquote></div>
<br>_______________________________________________<br>users mailing list<br>users@rtems.org<br>http://lists.rtems.org/mailman/listinfo/users</div></div><br></div></div></body></html>