<i>[tcl] unix build of the 8.5 branch fails to build on Mac OS X with LTO (-flto)</i>.
by
.
D 2016-09-13T14:57:19.080
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment I\sdon't\sthink\sI\sever\sgot\saround\sreporting\sthis\sissue\shere:\r\n\r\nBuilding\sthe\sgeneric\sUnix\sflavour\sof\sTcl\s8.5\son\sOS\sX\s(as\sdone\sfor\sinstance\sby\sMacPorts\sto\sobtain\sthe\sinterpreter\sdriving\sthe\sentire\sbuild/packaging\ssystem)\sfails\swhen\susing\sLink-Time\sOptimisation\s(-flto\scompiler/linker\soption).\r\n\r\nWhen\sthis\soption\sis\sused,\sthe\sTcl\sbuild\ssystem\serroneously\sdetects\sthe\spresence\sof\sthe\spthread_attr_get_np()\sfunction\swhich\sexists\sonly\son\sLinux;\sas\sa\sresult,\scompilation\sfails\son\s#include\s<pthread_np.h>\s.\r\n\r\nThis\sissue\sboils\sdown\sto\sa\sfailing\sconftest.c\sprogramme\sgenerated\sby\sthe\sconfigure\sscript\s(and\sI\sthink\sspecified\sby\sthe\stcl.m4\sfile).\sIn\sessence,\sthis\stest\sdoes\r\n\r\nmain\s()\s{\r\n\s\s\s\schar\spthread_attr_get_np();\r\n\s\s\s\schar\s(*f)()\s=\spthread_attr_get_np;\r\n\s\s\s\sreturn\sf\s!=\spthread_attr_get_np;\r\n}\r\n\r\nSemantically,\sthe\sactual\svalue\sof\sf\sis\smoot\sin\sthe\sboolean\sexpression,\swhich\sin\sfact\scan\sonly\sevaluate\sto\sfalse.\sWith\sLTO\sactivated,\sclang\srecognises\sthis\sfact,\ssuppresses\sthe\sreference\sto\sthe\sactual\sfunction\sand\sas\sa\sresult\sdoes\snot\sfail\sto\slink\swhen\sthat\sfunction\sisn't\savailable.\r\n\r\nAdding\sa\scall\sto\sa\sfunction\swith\sside-effects\s(unknown\sto\sthe\slinker,\ssuch\sas\sprintf("%p",\spthread_attr_get_np);\srestores\sthe\sexpected\sbehaviour\s(i.e.\sthe\slink\sstep\sfails,\sand\sthus\sthe\stest\salso).
J foundin 8.5
J is_private 0
J login anonymous
J priority 5\sMedium
J private_contact feaf88b9ff5360927d4e110eb8bf5ebfc61e7c2d
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem 53.\sConfiguration\sand\sBuild\sTools
J title [tcl]\sunix\sbuild\sof\sthe\s8.5\sbranch\sfails\sto\sbuild\son\sMac\sOS\sX\swith\sLTO\s(-flto)
J type Bug
K 4d72a5f77f268c6882d974562e53a34354273a31
U anonymous
Z 45fbd4777ad3aeb95843e1e57322db45