001-elfutils-portability.patch 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871
  1. --- elfutils/backends/ChangeLog
  2. +++ elfutils/backends/ChangeLog
  3. @@ -433,6 +433,10 @@
  4. * ppc_attrs.c (ppc_check_object_attribute): Handle tag
  5. GNU_Power_ABI_Struct_Return.
  6. +2009-01-23 Roland McGrath <roland@redhat.com>
  7. +
  8. + * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
  9. +
  10. 2008-10-04 Ulrich Drepper <drepper@redhat.com>
  11. * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
  12. @@ -760,6 +764,11 @@
  13. * sparc_init.c: Likewise.
  14. * x86_64_init.c: Likewise.
  15. +2005-11-22 Roland McGrath <roland@redhat.com>
  16. +
  17. + * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
  18. + (libebl_%.so rule): Use it in place of -Wl,--as-needed.
  19. +
  20. 2005-11-19 Roland McGrath <roland@redhat.com>
  21. * ppc64_reloc.def: REL30 -> ADDR30.
  22. @@ -782,6 +791,9 @@
  23. * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
  24. (CLEANFILES): Add libebl_$(m).so.
  25. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  26. + (AM_CFLAGS): Use it in place of -Wextra.
  27. +
  28. * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
  29. * ppc64_reloc.def: Likewise.
  30. --- elfutils/backends/Makefile.am
  31. +++ elfutils/backends/Makefile.am
  32. @@ -119,7 +119,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
  33. $(LINK) -shared -o $(@:.map=.so) \
  34. -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
  35. -Wl,--version-script,$(@:.so=.map) \
  36. - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
  37. + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw)
  38. @$(textrel_check)
  39. libebl_i386.so: $(cpu_i386)
  40. --- elfutils/backends/Makefile.in
  41. +++ elfutils/backends/Makefile.in
  42. @@ -83,6 +83,7 @@ host_triplet = @host@
  43. DIST_COMMON = $(top_srcdir)/config/eu.am $(srcdir)/Makefile.in \
  44. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  45. $(noinst_HEADERS) ChangeLog
  46. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  47. subdir = backends
  48. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  49. am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
  50. @@ -285,6 +286,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  51. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  52. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  53. LDFLAGS = @LDFLAGS@
  54. +LD_AS_NEEDED = @LD_AS_NEEDED@
  55. LEX = @LEX@
  56. LEXLIB = @LEXLIB@
  57. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  58. @@ -316,6 +318,7 @@ SHELL = @SHELL@
  59. STRIP = @STRIP@
  60. USE_NLS = @USE_NLS@
  61. VERSION = @VERSION@
  62. +WEXTRA = @WEXTRA@
  63. XGETTEXT = @XGETTEXT@
  64. XGETTEXT_015 = @XGETTEXT_015@
  65. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  66. @@ -378,11 +381,11 @@ zip_LIBS = @zip_LIBS@
  67. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
  68. -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
  69. -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
  70. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
  71. - $(if $($(*F)_no_Werror),,-Werror) \
  72. - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
  73. - $($(*F)_CFLAGS)
  74. -
  75. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  76. + $($(*F)_no_Werror),,-Werror) $(if \
  77. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  78. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  79. + $(am__append_1)
  80. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  81. CLEANFILES = *.gcno *.gcda $(foreach m,$(modules), libebl_$(m).map \
  82. libebl_$(m).so $(am_libebl_$(m)_pic_a_OBJECTS))
  83. @@ -888,7 +891,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
  84. $(LINK) -shared -o $(@:.map=.so) \
  85. -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
  86. -Wl,--version-script,$(@:.so=.map) \
  87. - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
  88. + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw)
  89. @$(textrel_check)
  90. libebl_i386.so: $(cpu_i386)
  91. --- elfutils/ChangeLog
  92. +++ elfutils/ChangeLog
  93. @@ -187,6 +187,8 @@
  94. 2012-01-24 Mark Wielaard <mjw@redhat.com>
  95. + * configure.ac: Wrap AC_COMPILE_IFELSE sources in AC_LANG_SOURCE.
  96. +
  97. * COPYING: Fix address. Updated version from gnulib.
  98. 2012-01-23 Mark Wielaard <mjw@redhat.com>
  99. @@ -205,6 +207,9 @@
  100. 2011-10-08 Mike Frysinger <vapier@gentoo.org>
  101. + * configure.ac (--disable-werror): Handle it, controlling BUILD_WERROR
  102. + automake option.
  103. +
  104. * configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly.
  105. 2011-10-02 Ulrich Drepper <drepper@gmail.com>
  106. @@ -226,6 +231,10 @@
  107. * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
  108. +2009-11-22 Roland McGrath <roland@redhat.com>
  109. +
  110. + * configure.ac: Use sed and expr instead of modern bash extensions.
  111. +
  112. 2009-09-21 Ulrich Drepper <drepper@redhat.com>
  113. * configure.ac: Update for more modern autoconf.
  114. @@ -234,6 +243,10 @@
  115. * configure.ac (zip_LIBS): Check for liblzma too.
  116. +2009-08-17 Roland McGrath <roland@redhat.com>
  117. +
  118. + * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
  119. +
  120. 2009-04-19 Roland McGrath <roland@redhat.com>
  121. * configure.ac (eu_version): Round down here, not in version.h macros.
  122. @@ -245,6 +258,8 @@
  123. 2009-01-23 Roland McGrath <roland@redhat.com>
  124. + * configure.ac: Check for __builtin_popcount.
  125. +
  126. * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
  127. * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
  128. @@ -325,6 +340,10 @@
  129. * configure.ac: Add dummy automake conditional to get dependencies
  130. for non-generic linker right. See src/Makefile.am.
  131. +2005-11-22 Roland McGrath <roland@redhat.com>
  132. +
  133. + * configure.ac: Check for --as-needed linker option.
  134. +
  135. 2005-11-18 Roland McGrath <roland@redhat.com>
  136. * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
  137. @@ -372,6 +391,17 @@
  138. * Makefile.am (all_SUBDIRS): Add libdwfl.
  139. * configure.ac: Write libdwfl/Makefile.
  140. +2005-05-31 Roland McGrath <roland@redhat.com>
  141. +
  142. + * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
  143. +
  144. + * configure.ac: Check for struct stat st_?tim members.
  145. + * src/strip.c (process_file): Use st_?time if st_?tim are not there.
  146. +
  147. + * configure.ac: Check for futimes function.
  148. + * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
  149. + (handle_ar) [! HAVE_FUTIMES]: Likewise.
  150. +
  151. 2005-05-19 Roland McGrath <roland@redhat.com>
  152. * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
  153. --- elfutils/config/ChangeLog
  154. +++ elfutils/config/ChangeLog
  155. @@ -71,6 +71,10 @@
  156. * known-dwarf.awk: Use gawk.
  157. +2011-10-08 Mike Frysinger <vapier@gentoo.org>
  158. +
  159. + * eu.am [BUILD_WERROR]: Conditionalize -Werror use on this.
  160. +
  161. 2010-07-02 Ulrich Drepper <drepper@redhat.com>
  162. * elfutils.spec.in: Add more BuildRequires.
  163. --- elfutils/config/eu.am
  164. +++ elfutils/config/eu.am
  165. @@ -1,6 +1,6 @@
  166. ## Common automake fragments for elfutils subdirectory makefiles.
  167. ##
  168. -## Copyright (C) 2010, 2014 Red Hat, Inc.
  169. +## Copyright (C) 2010-2011, 2014 Red Hat, Inc.
  170. ##
  171. ## This file is part of elfutils.
  172. ##
  173. @@ -29,13 +29,21 @@
  174. ## not, see <http://www.gnu.org/licenses/>.
  175. ##
  176. +WEXTRA = @WEXTRA@
  177. +LD_AS_NEEDED = @LD_AS_NEEDED@
  178. +
  179. DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
  180. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
  181. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
  182. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
  183. $(if $($(*F)_no_Werror),,-Werror) \
  184. - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
  185. + $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
  186. + $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
  187. $($(*F)_CFLAGS)
  188. +if BUILD_WERROR
  189. +AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror)
  190. +endif
  191. +
  192. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  193. %.os: %.c %.o
  194. --- elfutils/config/Makefile.in
  195. +++ elfutils/config/Makefile.in
  196. @@ -147,6 +147,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  197. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  198. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  199. LDFLAGS = @LDFLAGS@
  200. +LD_AS_NEEDED = @LD_AS_NEEDED@
  201. LEX = @LEX@
  202. LEXLIB = @LEXLIB@
  203. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  204. @@ -178,6 +179,7 @@ SHELL = @SHELL@
  205. STRIP = @STRIP@
  206. USE_NLS = @USE_NLS@
  207. VERSION = @VERSION@
  208. +WEXTRA = @WEXTRA@
  209. XGETTEXT = @XGETTEXT@
  210. XGETTEXT_015 = @XGETTEXT_015@
  211. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  212. --- elfutils/config.h.in
  213. +++ elfutils/config.h.in
  214. @@ -3,6 +3,9 @@
  215. /* Should ar and ranlib use -D behavior by default? */
  216. #undef DEFAULT_AR_DETERMINISTIC
  217. +/* Have __builtin_popcount. */
  218. +#undef HAVE_BUILTIN_POPCOUNT
  219. +
  220. /* Define to 1 if you have the <inttypes.h> header file. */
  221. #undef HAVE_INTTYPES_H
  222. @@ -102,4 +105,7 @@
  223. /* Define for large files, on AIX-style hosts. */
  224. #undef _LARGE_FILES
  225. +/* Stubbed out if missing compiler support. */
  226. +#undef __thread
  227. +
  228. #include <eu-config.h>
  229. --- elfutils/configure
  230. +++ elfutils/configure
  231. @@ -663,6 +663,8 @@ ZLIB_TRUE
  232. LIBEBL_SUBDIR
  233. TESTS_RPATH_FALSE
  234. TESTS_RPATH_TRUE
  235. +BUILD_WERROR_FALSE
  236. +BUILD_WERROR_TRUE
  237. BUILD_STATIC_FALSE
  238. BUILD_STATIC_TRUE
  239. USE_VALGRIND_FALSE
  240. @@ -678,6 +680,8 @@ NEVER_TRUE
  241. base_cpu
  242. NATIVE_LD_FALSE
  243. NATIVE_LD_TRUE
  244. +LD_AS_NEEDED
  245. +WEXTRA
  246. NM
  247. READELF
  248. ac_ct_AR
  249. @@ -798,6 +802,7 @@ enable_debugpred
  250. enable_gprof
  251. enable_gcov
  252. enable_valgrind
  253. +enable_werror
  254. enable_tests_rpath
  255. enable_libebl_subdir
  256. with_zlib
  257. @@ -1455,6 +1460,7 @@ Optional Features:
  258. --enable-gprof build binaries with gprof support
  259. --enable-gcov build binaries with gcov support
  260. --enable-valgrind run all tests under valgrind
  261. + --disable-werror do not build with -Werror
  262. --enable-tests-rpath build $ORIGIN-using rpath into tests
  263. --enable-libebl-subdir=DIR
  264. install libebl_CPU modules in $(libdir)/DIR
  265. @@ -4843,6 +4849,130 @@ if test "x$ac_cv_c99" != xyes; then :
  266. as_fn_error $? "gcc with C99 support required" "$LINENO" 5
  267. fi
  268. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra option to $CC" >&5
  269. +$as_echo_n "checking for -Wextra option to $CC... " >&6; }
  270. +if ${ac_cv_cc_wextra+:} false; then :
  271. + $as_echo_n "(cached) " >&6
  272. +else
  273. + old_CFLAGS="$CFLAGS"
  274. +CFLAGS="$CFLAGS -Wextra"
  275. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  276. +/* end confdefs.h. */
  277. +void foo (void) { }
  278. +_ACEOF
  279. +if ac_fn_c_try_compile "$LINENO"; then :
  280. + ac_cv_cc_wextra=yes
  281. +else
  282. + ac_cv_cc_wextra=no
  283. +fi
  284. +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  285. +CFLAGS="$old_CFLAGS"
  286. +fi
  287. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_wextra" >&5
  288. +$as_echo "$ac_cv_cc_wextra" >&6; }
  289. +
  290. +if test "x$ac_cv_cc_wextra" = xyes; then :
  291. + WEXTRA=-Wextra
  292. +else
  293. + WEXTRA=-W
  294. +fi
  295. +
  296. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fgnu89-inline option to $CC" >&5
  297. +$as_echo_n "checking for -fgnu89-inline option to $CC... " >&6; }
  298. +if ${ac_cv_cc_gnu89_inline+:} false; then :
  299. + $as_echo_n "(cached) " >&6
  300. +else
  301. + old_CFLAGS="$CFLAGS"
  302. +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
  303. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  304. +/* end confdefs.h. */
  305. +
  306. +void foo (void)
  307. +{
  308. + inline void bar (void) {}
  309. + bar ();
  310. +}
  311. +extern inline void baz (void) {}
  312. +
  313. +_ACEOF
  314. +if ac_fn_c_try_compile "$LINENO"; then :
  315. + ac_cv_cc_gnu89_inline=yes
  316. +else
  317. + ac_cv_cc_gnu89_inline=no
  318. +fi
  319. +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  320. +CFLAGS="$old_CFLAGS"
  321. +fi
  322. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_gnu89_inline" >&5
  323. +$as_echo "$ac_cv_cc_gnu89_inline" >&6; }
  324. +if test "x$ac_cv_cc_gnu89_inline" = xyes; then :
  325. + WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"
  326. +fi
  327. +
  328. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --as-needed linker option" >&5
  329. +$as_echo_n "checking for --as-needed linker option... " >&6; }
  330. +if ${ac_cv_as_needed+:} false; then :
  331. + $as_echo_n "(cached) " >&6
  332. +else
  333. + cat > conftest.c <<EOF
  334. +int main (void) { return 0; }
  335. +EOF
  336. +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
  337. + -fPIC -shared -o conftest.so conftest.c
  338. + -Wl,--as-needed 1>&5'
  339. + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  340. + (eval $ac_try) 2>&5
  341. + ac_status=$?
  342. + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  343. + test $ac_status = 0; }; }
  344. +then
  345. + ac_cv_as_needed=yes
  346. +else
  347. + ac_cv_as_needed=no
  348. +fi
  349. +rm -f conftest*
  350. +fi
  351. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_as_needed" >&5
  352. +$as_echo "$ac_cv_as_needed" >&6; }
  353. +if test "x$ac_cv_as_needed" = xyes; then :
  354. + LD_AS_NEEDED=-Wl,--as-needed
  355. +else
  356. + LD_AS_NEEDED=
  357. +fi
  358. +
  359. +
  360. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5
  361. +$as_echo_n "checking for __builtin_popcount... " >&6; }
  362. +if ${ac_cv_popcount+:} false; then :
  363. + $as_echo_n "(cached) " >&6
  364. +else
  365. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  366. +/* end confdefs.h. */
  367. +
  368. +int
  369. +main ()
  370. +{
  371. +exit (__builtin_popcount (127));
  372. + ;
  373. + return 0;
  374. +}
  375. +_ACEOF
  376. +if ac_fn_c_try_link "$LINENO"; then :
  377. + ac_cv_popcount=yes
  378. +else
  379. + ac_cv_popcount=no
  380. +fi
  381. +rm -f core conftest.err conftest.$ac_objext \
  382. + conftest$ac_exeext conftest.$ac_ext
  383. +fi
  384. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_popcount" >&5
  385. +$as_echo "$ac_cv_popcount" >&6; }
  386. +if test "x$ac_cv_popcount" = xyes; then :
  387. +
  388. +$as_echo "#define HAVE_BUILTIN_POPCOUNT 1" >>confdefs.h
  389. +
  390. +fi
  391. +
  392. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __thread support" >&5
  393. $as_echo_n "checking for __thread support... " >&6; }
  394. if ${ac_cv_tls+:} false; then :
  395. @@ -4879,7 +5009,13 @@ fi
  396. { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
  397. $as_echo "$ac_cv_tls" >&6; }
  398. if test "x$ac_cv_tls" != xyes; then :
  399. - as_fn_error $? "__thread support required" "$LINENO" 5
  400. + if test "$use_locks" = yes; then :
  401. + as_fn_error $? "--enable-thread-safety requires __thread support" "$LINENO" 5
  402. +else
  403. +
  404. +$as_echo "#define __thread /* empty: no multi-thread support */" >>confdefs.h
  405. +
  406. +fi
  407. fi
  408. # Check whether --enable-largefile was given.
  409. @@ -5246,6 +5382,22 @@ else
  410. fi
  411. +# Check whether --enable-werror was given.
  412. +if test "${enable_werror+set}" = set; then :
  413. + enableval=$enable_werror; enable_werror=$enableval
  414. +else
  415. + enable_werror=yes
  416. +fi
  417. +
  418. + if test "$enable_werror" = yes; then
  419. + BUILD_WERROR_TRUE=
  420. + BUILD_WERROR_FALSE='#'
  421. +else
  422. + BUILD_WERROR_TRUE='#'
  423. + BUILD_WERROR_FALSE=
  424. +fi
  425. +
  426. +
  427. # Check whether --enable-tests-rpath was given.
  428. if test "${enable_tests_rpath+set}" = set; then :
  429. enableval=$enable_tests_rpath; tests_use_rpath=$enableval
  430. @@ -5983,7 +6135,7 @@ case "$eu_version" in
  431. esac
  432. # Round up to the next release API (x.y) version.
  433. -eu_version=$(( (eu_version + 999) / 1000 ))
  434. +eu_version=`expr \( $eu_version + 999 \) / 1000`
  435. ac_ext=c
  436. ac_cpp='$CPP $CPPFLAGS'
  437. @@ -6729,6 +6881,10 @@ if test -z "${BUILD_STATIC_TRUE}" && tes
  438. as_fn_error $? "conditional \"BUILD_STATIC\" was never defined.
  439. Usually this means the macro was only invoked conditionally." "$LINENO" 5
  440. fi
  441. +if test -z "${BUILD_WERROR_TRUE}" && test -z "${BUILD_WERROR_FALSE}"; then
  442. + as_fn_error $? "conditional \"BUILD_WERROR\" was never defined.
  443. +Usually this means the macro was only invoked conditionally." "$LINENO" 5
  444. +fi
  445. if test -z "${TESTS_RPATH_TRUE}" && test -z "${TESTS_RPATH_FALSE}"; then
  446. as_fn_error $? "conditional \"TESTS_RPATH\" was never defined.
  447. Usually this means the macro was only invoked conditionally." "$LINENO" 5
  448. --- elfutils/configure.ac
  449. +++ elfutils/configure.ac
  450. @@ -89,6 +89,54 @@ CFLAGS="$old_CFLAGS"])
  451. AS_IF([test "x$ac_cv_c99" != xyes],
  452. AC_MSG_ERROR([gcc with C99 support required]))
  453. +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
  454. +old_CFLAGS="$CFLAGS"
  455. +CFLAGS="$CFLAGS -Wextra"
  456. +AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo (void) { }])],
  457. + ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
  458. +CFLAGS="$old_CFLAGS"])
  459. +AC_SUBST(WEXTRA)
  460. +AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
  461. +
  462. +AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
  463. +old_CFLAGS="$CFLAGS"
  464. +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
  465. +AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  466. +void foo (void)
  467. +{
  468. + inline void bar (void) {}
  469. + bar ();
  470. +}
  471. +extern inline void baz (void) {}
  472. +])], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
  473. +CFLAGS="$old_CFLAGS"])
  474. +AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
  475. + [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
  476. +
  477. +AC_CACHE_CHECK([for --as-needed linker option],
  478. + ac_cv_as_needed, [dnl
  479. +cat > conftest.c <<EOF
  480. +int main (void) { return 0; }
  481. +EOF
  482. +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
  483. + -fPIC -shared -o conftest.so conftest.c
  484. + -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
  485. +then
  486. + ac_cv_as_needed=yes
  487. +else
  488. + ac_cv_as_needed=no
  489. +fi
  490. +rm -f conftest*])
  491. +AS_IF([test "x$ac_cv_as_needed" = xyes],
  492. + [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
  493. +AC_SUBST(LD_AS_NEEDED)
  494. +
  495. +AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
  496. +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
  497. + ac_cv_popcount=yes, ac_cv_popcount=no)])
  498. +AS_IF([test "x$ac_cv_popcount" = xyes],
  499. + [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
  500. +
  501. AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
  502. # Use the same flags that we use for our DSOs, so the test is representative.
  503. # Some old compiler/linker/libc combinations fail some ways and not others.
  504. @@ -104,7 +152,10 @@ static __thread int a; int foo (int b) {
  505. CFLAGS="$save_CFLAGS"
  506. LDFLAGS="$save_LDFLAGS"])
  507. AS_IF([test "x$ac_cv_tls" != xyes],
  508. - AC_MSG_ERROR([__thread support required]))
  509. + [AS_IF([test "$use_locks" = yes],
  510. + [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
  511. + [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
  512. + [Stubbed out if missing compiler support.])])])
  513. dnl This test must come as early as possible after the compiler configuration
  514. dnl tests, because the choice of the file model can (in principle) affect
  515. @@ -183,6 +234,11 @@ AM_CONDITIONAL(USE_VALGRIND, test "$use_
  516. AM_CONDITIONAL(BUILD_STATIC, [dnl
  517. test "$use_gprof" = yes -o "$use_gcov" = yes])
  518. +AC_ARG_ENABLE([werror],
  519. +AS_HELP_STRING([--disable-werror],[do not build with -Werror]),
  520. + [enable_werror=$enableval], [enable_werror=yes])
  521. +AM_CONDITIONAL(BUILD_WERROR, test "$enable_werror" = yes)
  522. +
  523. AC_ARG_ENABLE([tests-rpath],
  524. AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
  525. [tests_use_rpath=$enableval], [tests_use_rpath=no])
  526. @@ -302,7 +358,7 @@ case "$eu_version" in
  527. esac
  528. # Round up to the next release API (x.y) version.
  529. -eu_version=$(( (eu_version + 999) / 1000 ))
  530. +eu_version=`expr \( $eu_version + 999 \) / 1000`
  531. AC_CHECK_SIZEOF(long)
  532. --- elfutils/lib/ChangeLog
  533. +++ elfutils/lib/ChangeLog
  534. @@ -65,6 +65,9 @@
  535. 2009-01-23 Roland McGrath <roland@redhat.com>
  536. + * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
  537. + (__builtin_popcount): New inline function.
  538. +
  539. * eu-config.h: Add multiple inclusion protection.
  540. 2009-01-17 Ulrich Drepper <drepper@redhat.com>
  541. @@ -121,6 +124,11 @@
  542. * Makefile.am (libeu_a_SOURCES): Add it.
  543. * system.h: Declare crc32_file.
  544. +2005-02-07 Roland McGrath <roland@redhat.com>
  545. +
  546. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  547. + (AM_CFLAGS): Use it in place of -Wextra.
  548. +
  549. 2005-04-30 Ulrich Drepper <drepper@redhat.com>
  550. * Makefile.am: Use -ffunction-sections for xmalloc.c.
  551. --- elfutils/lib/eu-config.h
  552. +++ elfutils/lib/eu-config.h
  553. @@ -162,6 +162,17 @@ asm (".section predict_data, \"aw\"; .pr
  554. /* This macro is used by the tests conditionalize for standalone building. */
  555. #define ELFUTILS_HEADER(name) <lib##name.h>
  556. +#ifndef HAVE_BUILTIN_POPCOUNT
  557. +# define __builtin_popcount hakmem_popcount
  558. +static inline unsigned int __attribute__ ((unused))
  559. +hakmem_popcount (unsigned int x)
  560. +{
  561. + /* HAKMEM 169 */
  562. + unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
  563. + return ((n + (n >> 3)) & 030707070707) % 63;
  564. +}
  565. +#endif /* HAVE_BUILTIN_POPCOUNT */
  566. +
  567. #ifdef SHARED
  568. # define OLD_VERSION(name, version) \
  569. --- elfutils/lib/Makefile.in
  570. +++ elfutils/lib/Makefile.in
  571. @@ -82,6 +82,7 @@ host_triplet = @host@
  572. DIST_COMMON = $(top_srcdir)/config/eu.am $(srcdir)/Makefile.in \
  573. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  574. $(noinst_HEADERS) ChangeLog
  575. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  576. subdir = lib
  577. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  578. am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
  579. @@ -197,6 +198,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  580. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  581. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  582. LDFLAGS = @LDFLAGS@
  583. +LD_AS_NEEDED = @LD_AS_NEEDED@
  584. LEX = @LEX@
  585. LEXLIB = @LEXLIB@
  586. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  587. @@ -228,6 +230,7 @@ SHELL = @SHELL@
  588. STRIP = @STRIP@
  589. USE_NLS = @USE_NLS@
  590. VERSION = @VERSION@
  591. +WEXTRA = @WEXTRA@
  592. XGETTEXT = @XGETTEXT@
  593. XGETTEXT_015 = @XGETTEXT_015@
  594. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  595. @@ -289,9 +292,11 @@ top_srcdir = @top_srcdir@
  596. zip_LIBS = @zip_LIBS@
  597. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
  598. -I$(srcdir)/../libelf
  599. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
  600. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  601. $($(*F)_no_Werror),,-Werror) $(if \
  602. - $($(*F)_no_Wunused),,-Wunused -Wextra) $($(*F)_CFLAGS) -fpic
  603. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  604. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  605. + $(am__append_1) -fpic
  606. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  607. CLEANFILES = *.gcno *.gcda
  608. textrel_msg = echo "WARNING: TEXTREL found in '$@'"
  609. --- elfutils/libasm/ChangeLog
  610. +++ elfutils/libasm/ChangeLog
  611. @@ -87,6 +87,11 @@
  612. * asm_error.c: Add new error ASM_E_IOERROR.
  613. * libasmP.h: Add ASM_E_IOERROR definition.
  614. +2005-05-31 Roland McGrath <roland@redhat.com>
  615. +
  616. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  617. + (AM_CFLAGS): Use it in place of -Wextra.
  618. +
  619. 2005-02-15 Ulrich Drepper <drepper@redhat.com>
  620. * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
  621. --- elfutils/libasm/Makefile.in
  622. +++ elfutils/libasm/Makefile.in
  623. @@ -83,8 +83,9 @@ host_triplet = @host@
  624. DIST_COMMON = $(top_srcdir)/config/eu.am $(srcdir)/Makefile.in \
  625. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  626. $(noinst_HEADERS) $(pkginclude_HEADERS) ChangeLog
  627. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  628. noinst_PROGRAMS = $(am__EXEEXT_1)
  629. -@USE_LOCKS_TRUE@am__append_1 = -lpthread
  630. +@USE_LOCKS_TRUE@am__append_2 = -lpthread
  631. subdir = libasm
  632. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  633. am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
  634. @@ -248,6 +249,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  635. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  636. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  637. LDFLAGS = @LDFLAGS@
  638. +LD_AS_NEEDED = @LD_AS_NEEDED@
  639. LEX = @LEX@
  640. LEXLIB = @LEXLIB@
  641. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  642. @@ -279,6 +281,7 @@ SHELL = @SHELL@
  643. STRIP = @STRIP@
  644. USE_NLS = @USE_NLS@
  645. VERSION = 1
  646. +WEXTRA = @WEXTRA@
  647. XGETTEXT = @XGETTEXT@
  648. XGETTEXT_015 = @XGETTEXT_015@
  649. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  650. @@ -341,11 +344,11 @@ zip_LIBS = @zip_LIBS@
  651. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
  652. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
  653. -I$(top_srcdir)/libdw
  654. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
  655. - $(if $($(*F)_no_Werror),,-Werror) \
  656. - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
  657. - $($(*F)_CFLAGS)
  658. -
  659. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  660. + $($(*F)_no_Werror),,-Werror) $(if \
  661. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  662. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  663. + $(am__append_1)
  664. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  665. CLEANFILES = *.gcno *.gcda $(am_libasm_pic_a_OBJECTS) \
  666. libasm.so.$(VERSION)
  667. @@ -373,7 +376,7 @@ libasm_a_SOURCES = asm_begin.c asm_abort
  668. libasm_pic_a_SOURCES =
  669. am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
  670. -libasm_so_LDLIBS = $(am__append_1)
  671. +libasm_so_LDLIBS = $(am__append_2)
  672. libasm_so_SOURCES =
  673. noinst_HEADERS = libasmP.h symbolhash.h
  674. EXTRA_DIST = libasm.map
  675. --- elfutils/libcpu/ChangeLog
  676. +++ elfutils/libcpu/ChangeLog
  677. @@ -51,6 +51,9 @@
  678. 2009-01-23 Roland McGrath <roland@redhat.com>
  679. + * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
  680. + compilers that don't realize it's noreturn.
  681. +
  682. * Makefile.am (i386_parse_CFLAGS): Use quotes around command
  683. substitution that can produce leading whitespace.
  684. @@ -380,6 +383,11 @@
  685. * defs/i386.doc: New file.
  686. * defs/x86_64: New file.
  687. +2005-04-04 Roland McGrath <roland@redhat.com>
  688. +
  689. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  690. + (AM_CFLAGS): Use it instead of -Wextra.
  691. +
  692. 2005-02-15 Ulrich Drepper <drepper@redhat.com>
  693. * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
  694. --- elfutils/libcpu/i386_disasm.c
  695. +++ elfutils/libcpu/i386_disasm.c
  696. @@ -822,6 +822,7 @@ i386_disasm (const uint8_t **startp, con
  697. default:
  698. assert (! "INVALID not handled");
  699. + abort ();
  700. }
  701. }
  702. else
  703. --- elfutils/libcpu/Makefile.in
  704. +++ elfutils/libcpu/Makefile.in
  705. @@ -84,6 +84,7 @@ DIST_COMMON = $(top_srcdir)/config/eu.am
  706. $(srcdir)/Makefile.am i386_lex.c i386_parse.c \
  707. $(top_srcdir)/config/depcomp $(top_srcdir)/config/ylwrap \
  708. $(am__noinst_HEADERS_DIST) ChangeLog
  709. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  710. @MAINTAINER_MODE_TRUE@noinst_PROGRAMS = i386_gendis$(EXEEXT)
  711. subdir = libcpu
  712. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  713. @@ -223,6 +224,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  714. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  715. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  716. LDFLAGS = @LDFLAGS@
  717. +LD_AS_NEEDED = @LD_AS_NEEDED@
  718. LEX = @LEX@
  719. LEXLIB = @LEXLIB@
  720. LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
  721. @@ -254,6 +256,7 @@ SHELL = @SHELL@
  722. STRIP = @STRIP@
  723. USE_NLS = @USE_NLS@
  724. VERSION = @VERSION@
  725. +WEXTRA = @WEXTRA@
  726. XGETTEXT = @XGETTEXT@
  727. XGETTEXT_015 = @XGETTEXT_015@
  728. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  729. @@ -316,10 +319,11 @@ zip_LIBS = @zip_LIBS@
  730. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
  731. -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
  732. -I$(srcdir)/../libdw -I$(srcdir)/../libasm
  733. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
  734. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  735. $($(*F)_no_Werror),,-Werror) $(if \
  736. - $($(*F)_no_Wunused),,-Wunused -Wextra) $($(*F)_CFLAGS) -fpic \
  737. - -fdollars-in-identifiers
  738. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  739. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  740. + $(am__append_1) -fpic -fdollars-in-identifiers
  741. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  742. CLEANFILES = *.gcno *.gcda $(foreach P,i386 x86_64,$P_defs \
  743. $P.mnemonics)
  744. --- elfutils/libdw/ChangeLog
  745. +++ elfutils/libdw/ChangeLog
  746. @@ -717,6 +717,10 @@
  747. * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
  748. +2011-07-20 Mark Wielaard <mjw@redhat.com>
  749. +
  750. + * dwarf_begin_elf.c: Add fallback for be64toh if not defined.
  751. +
  752. 2011-07-14 Mark Wielaard <mjw@redhat.com>
  753. * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
  754. @@ -1076,6 +1080,10 @@
  755. * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
  756. +2009-08-17 Roland McGrath <roland@redhat.com>
  757. +
  758. + * libdw.h: Disable extern inlines for GCC 4.2.
  759. +
  760. 2009-08-10 Roland McGrath <roland@redhat.com>
  761. * dwarf_getscopevar.c: Use dwarf_diename.
  762. @@ -1844,6 +1852,11 @@
  763. 2005-05-31 Roland McGrath <roland@redhat.com>
  764. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  765. + (AM_CFLAGS): Use it in place of -Wextra.
  766. +
  767. +2005-05-31 Roland McGrath <roland@redhat.com>
  768. +
  769. * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
  770. formref offset.
  771. --- elfutils/libdw/dwarf_begin_elf.c
  772. +++ elfutils/libdw/dwarf_begin_elf.c
  773. @@ -47,6 +47,14 @@
  774. #if USE_ZLIB
  775. # include <endian.h>
  776. # define crc32 loser_crc32
  777. +# ifndef be64toh
  778. +# include <byteswap.h>
  779. +# if __BYTE_ORDER == __LITTLE_ENDIAN
  780. +# define be64toh(x) bswap_64 (x)
  781. +# else
  782. +# define be64toh(x) (x)
  783. +# endif
  784. +# endif
  785. # include <zlib.h>
  786. # undef crc32
  787. #endif
  788. --- elfutils/libdw/libdw.h
  789. +++ elfutils/libdw/libdw.h
  790. @@ -1003,7 +1003,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
  791. /* Inline optimizations. */
  792. -#ifdef __OPTIMIZE__
  793. +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
  794. /* Return attribute code of given attribute. */
  795. __libdw_extern_inline unsigned int
  796. dwarf_whatattr (Dwarf_Attribute *attr)
  797. --- elfutils/libdw/Makefile.in
  798. +++ elfutils/libdw/Makefile.in
  799. @@ -84,7 +84,8 @@ DIST_COMMON = $(top_srcdir)/config/eu.am
  800. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  801. $(include_HEADERS) $(noinst_HEADERS) $(pkginclude_HEADERS) \
  802. ChangeLog
  803. -@BUILD_STATIC_TRUE@am__append_1 = -fpic
  804. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  805. +@BUILD_STATIC_TRUE@am__append_2 = -fpic
  806. noinst_PROGRAMS = $(am__EXEEXT_1)
  807. subdir = libdw
  808. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  809. @@ -298,6 +299,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  810. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  811. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  812. LDFLAGS = @LDFLAGS@
  813. +LD_AS_NEEDED = @LD_AS_NEEDED@
  814. LEX = @LEX@
  815. LEXLIB = @LEXLIB@
  816. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  817. @@ -329,6 +331,7 @@ SHELL = @SHELL@
  818. STRIP = @STRIP@
  819. USE_NLS = @USE_NLS@
  820. VERSION = 1
  821. +WEXTRA = @WEXTRA@
  822. XGETTEXT = @XGETTEXT@
  823. XGETTEXT_015 = @XGETTEXT_015@
  824. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  825. @@ -390,10 +393,11 @@ top_srcdir = @top_srcdir@
  826. zip_LIBS = @zip_LIBS@
  827. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
  828. -I$(srcdir)/../libelf
  829. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
  830. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  831. $($(*F)_no_Werror),,-Werror) $(if \
  832. - $($(*F)_no_Wunused),,-Wunused -Wextra) $($(*F)_CFLAGS) \
  833. - $(am__append_1)
  834. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  835. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  836. + $(am__append_1) $(am__append_2)
  837. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  838. CLEANFILES = *.gcno *.gcda
  839. textrel_msg = echo "WARNING: TEXTREL found in '$@'"
  840. --- elfutils/libdwelf/Makefile.in
  841. +++ elfutils/libdwelf/Makefile.in
  842. @@ -82,6 +82,7 @@ host_triplet = @host@
  843. DIST_COMMON = $(top_srcdir)/config/eu.am $(srcdir)/Makefile.in \
  844. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  845. $(noinst_HEADERS) $(pkginclude_HEADERS) ChangeLog
  846. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  847. subdir = libdwelf
  848. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  849. am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
  850. @@ -227,6 +228,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  851. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  852. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  853. LDFLAGS = @LDFLAGS@
  854. +LD_AS_NEEDED = @LD_AS_NEEDED@
  855. LEX = @LEX@
  856. LEXLIB = @LEXLIB@
  857. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  858. @@ -258,6 +260,7 @@ SHELL = @SHELL@
  859. STRIP = @STRIP@
  860. USE_NLS = @USE_NLS@
  861. VERSION = 1
  862. +WEXTRA = @WEXTRA@
  863. XGETTEXT = @XGETTEXT@
  864. XGETTEXT_015 = @XGETTEXT_015@
  865. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  866. @@ -320,11 +323,11 @@ zip_LIBS = @zip_LIBS@
  867. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
  868. -I$(srcdir)/../libelf -I$(srcdir)/../libdw \
  869. -I$(srcdir)/../libdwfl -I$(srcdir)/../libebl
  870. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
  871. - $(if $($(*F)_no_Werror),,-Werror) \
  872. - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
  873. - $($(*F)_CFLAGS)
  874. -
  875. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  876. + $($(*F)_no_Werror),,-Werror) $(if \
  877. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  878. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  879. + $(am__append_1)
  880. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  881. CLEANFILES = *.gcno *.gcda $(am_libdwelf_pic_a_OBJECTS)
  882. textrel_msg = echo "WARNING: TEXTREL found in '$@'"
  883. --- elfutils/libdwfl/ChangeLog
  884. +++ elfutils/libdwfl/ChangeLog
  885. @@ -571,6 +571,21 @@
  886. (dwfl_module_addrsym) (i_to_symfile): New function.
  887. (dwfl_module_addrsym) (search_table): Use it.
  888. +2013-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>
  889. +
  890. + Older OS compatibility bits.
  891. + * linux-core-attach.c (be64toh, le64toh, be32toh, le32toh): Provide
  892. + fallbacks if not defined by system.
  893. +
  894. +2013-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>
  895. +
  896. + Handle T-stopped detach for old kernels.
  897. + * linux-pid-attach.c (struct pid_arg): New field stopped.
  898. + (ptrace_attach): New parameter stoppedp. Set it appropriately.
  899. + (pid_set_initial_registers): Pass the new field.
  900. + (pid_thread_detach): Handle the case of STOPPED for old kernels.
  901. + (__libdwfl_attach_state_for_pid): Initialize STOPPED.
  902. +
  903. 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
  904. Mark Wielaard <mjw@redhat.com>
  905. @@ -2336,6 +2351,11 @@
  906. 2005-07-21 Roland McGrath <roland@redhat.com>
  907. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  908. + (AM_CFLAGS): Use it in place of -Wextra.
  909. +
  910. +2005-07-21 Roland McGrath <roland@redhat.com>
  911. +
  912. * Makefile.am (noinst_HEADERS): Add loc2c.c.
  913. * test2.c (main): Check sscanf result to quiet warning.
  914. --- elfutils/libdwfl/linux-core-attach.c
  915. +++ elfutils/libdwfl/linux-core-attach.c
  916. @@ -29,6 +29,35 @@
  917. #include "libdwflP.h"
  918. #include <fcntl.h>
  919. #include "system.h"
  920. +#include <endian.h>
  921. +#include <byteswap.h>
  922. +#if __BYTE_ORDER == __LITTLE_ENDIAN
  923. +# ifndef be64toh
  924. +# define be64toh(x) bswap_64 (x)
  925. +# endif
  926. +# ifndef le64toh
  927. +# define le64toh(x) (x)
  928. +# endif
  929. +# ifndef be32toh
  930. +# define be32toh(x) bswap_32 (x)
  931. +# endif
  932. +# ifndef le32toh
  933. +# define le32toh(x) (x)
  934. +# endif
  935. +#else
  936. +# ifndef be64toh
  937. +# define be64toh(x) (x)
  938. +# endif
  939. +# ifndef le64toh
  940. +# define le64toh(x) bswap_64 (x)
  941. +# endif
  942. +# ifndef be32toh
  943. +# define be32toh(x) (x)
  944. +# endif
  945. +# ifndef le32toh
  946. +# define le32toh(x) bswap_32 (x)
  947. +# endif
  948. +#endif
  949. #include "../libdw/memory-access.h"
  950. --- elfutils/libdwfl/linux-pid-attach.c
  951. +++ elfutils/libdwfl/linux-pid-attach.c
  952. @@ -255,6 +255,11 @@ void
  953. internal_function
  954. __libdwfl_ptrace_detach (pid_t tid, bool tid_was_stopped)
  955. {
  956. + // Older kernels (tested kernel-2.6.18-348.12.1.el5.x86_64) need special
  957. + // handling of the detachment to keep the process State: T (stopped).
  958. + if (tid_was_stopped)
  959. + syscall (__NR_tkill, tid, SIGSTOP);
  960. +
  961. /* This handling is needed only on older Linux kernels such as
  962. 2.6.32-358.23.2.el6.ppc64. Later kernels such as
  963. 3.11.7-200.fc19.x86_64 remember the T (stopped) state
  964. @@ -262,6 +267,15 @@ __libdwfl_ptrace_detach (pid_t tid, bool
  965. PTRACE_DETACH. */
  966. ptrace (PTRACE_DETACH, tid, NULL,
  967. (void *) (intptr_t) (tid_was_stopped ? SIGSTOP : 0));
  968. +
  969. + if (tid_was_stopped)
  970. + {
  971. + // Wait till the SIGSTOP settles down.
  972. + int i;
  973. + for (i = 0; i < 100000; i++)
  974. + if (linux_proc_pid_is_stopped (tid))
  975. + break;
  976. + }
  977. }
  978. static void
  979. --- elfutils/libdwfl/Makefile.in
  980. +++ elfutils/libdwfl/Makefile.in
  981. @@ -82,9 +82,10 @@ host_triplet = @host@
  982. DIST_COMMON = $(top_srcdir)/config/eu.am $(srcdir)/Makefile.in \
  983. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  984. $(noinst_HEADERS) $(pkginclude_HEADERS) ChangeLog
  985. -@ZLIB_TRUE@am__append_1 = gzip.c
  986. -@BZLIB_TRUE@am__append_2 = bzip2.c
  987. -@LZMA_TRUE@am__append_3 = lzma.c
  988. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  989. +@ZLIB_TRUE@am__append_2 = gzip.c
  990. +@BZLIB_TRUE@am__append_3 = bzip2.c
  991. +@LZMA_TRUE@am__append_4 = lzma.c
  992. subdir = libdwfl
  993. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  994. am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
  995. @@ -286,6 +287,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  996. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  997. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  998. LDFLAGS = @LDFLAGS@
  999. +LD_AS_NEEDED = @LD_AS_NEEDED@
  1000. LEX = @LEX@
  1001. LEXLIB = @LEXLIB@
  1002. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  1003. @@ -317,6 +319,7 @@ SHELL = @SHELL@
  1004. STRIP = @STRIP@
  1005. USE_NLS = @USE_NLS@
  1006. VERSION = 1
  1007. +WEXTRA = @WEXTRA@
  1008. XGETTEXT = @XGETTEXT@
  1009. XGETTEXT_015 = @XGETTEXT_015@
  1010. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  1011. @@ -379,11 +382,11 @@ zip_LIBS = @zip_LIBS@
  1012. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. -I$(srcdir) \
  1013. -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
  1014. -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf
  1015. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
  1016. - $(if $($(*F)_no_Werror),,-Werror) \
  1017. - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
  1018. - $($(*F)_CFLAGS)
  1019. -
  1020. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  1021. + $($(*F)_no_Werror),,-Werror) $(if \
  1022. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  1023. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  1024. + $(am__append_1)
  1025. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  1026. CLEANFILES = *.gcno *.gcda $(am_libdwfl_pic_a_OBJECTS)
  1027. textrel_msg = echo "WARNING: TEXTREL found in '$@'"
  1028. @@ -413,8 +416,8 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en
  1029. dwfl_module_register_names.c dwfl_segment_report_module.c \
  1030. link_map.c core-file.c open.c image-header.c dwfl_frame.c \
  1031. frame_unwind.c dwfl_frame_pc.c linux-pid-attach.c \
  1032. - linux-core-attach.c dwfl_frame_regs.c $(am__append_1) \
  1033. - $(am__append_2) $(am__append_3)
  1034. + linux-core-attach.c dwfl_frame_regs.c $(am__append_2) \
  1035. + $(am__append_3) $(am__append_4)
  1036. libdwfl = $(libdw)
  1037. libdw = ../libdw/libdw.so
  1038. libelf = ../libelf/libelf.so
  1039. --- elfutils/libebl/ChangeLog
  1040. +++ elfutils/libebl/ChangeLog
  1041. @@ -765,6 +765,11 @@
  1042. * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
  1043. tracking works right.
  1044. +2005-05-31 Roland McGrath <roland@redhat.com>
  1045. +
  1046. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  1047. + (AM_CFLAGS): Use it in place of -Wextra.
  1048. +
  1049. 2005-05-21 Ulrich Drepper <drepper@redhat.com>
  1050. * libebl_x86_64.map: Add x86_64_core_note.
  1051. --- elfutils/libebl/Makefile.in
  1052. +++ elfutils/libebl/Makefile.in
  1053. @@ -82,6 +82,7 @@ host_triplet = @host@
  1054. DIST_COMMON = $(top_srcdir)/config/eu.am $(srcdir)/Makefile.in \
  1055. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  1056. $(noinst_HEADERS) $(pkginclude_HEADERS) ChangeLog
  1057. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  1058. subdir = libebl
  1059. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  1060. am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
  1061. @@ -249,6 +250,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1062. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  1063. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  1064. LDFLAGS = @LDFLAGS@
  1065. +LD_AS_NEEDED = @LD_AS_NEEDED@
  1066. LEX = @LEX@
  1067. LEXLIB = @LEXLIB@
  1068. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  1069. @@ -280,6 +282,7 @@ SHELL = @SHELL@
  1070. STRIP = @STRIP@
  1071. USE_NLS = @USE_NLS@
  1072. VERSION = 1
  1073. +WEXTRA = @WEXTRA@
  1074. XGETTEXT = @XGETTEXT@
  1075. XGETTEXT_015 = @XGETTEXT_015@
  1076. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  1077. @@ -342,9 +345,11 @@ zip_LIBS = @zip_LIBS@
  1078. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
  1079. -I$(srcdir)/../libelf -I$(srcdir)/../libdw \
  1080. -I$(srcdir)/../libasm
  1081. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
  1082. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  1083. $($(*F)_no_Werror),,-Werror) $(if \
  1084. - $($(*F)_no_Wunused),,-Wunused -Wextra) $($(*F)_CFLAGS) -fpic
  1085. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  1086. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  1087. + $(am__append_1) -fpic
  1088. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  1089. CLEANFILES = *.gcno *.gcda $(am_libebl_pic_a_OBJECTS)
  1090. textrel_msg = echo "WARNING: TEXTREL found in '$@'"
  1091. --- elfutils/libelf/ChangeLog
  1092. +++ elfutils/libelf/ChangeLog
  1093. @@ -244,6 +244,11 @@
  1094. * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
  1095. +2011-03-10 Roland McGrath <roland@redhat.com>
  1096. +
  1097. + * gnuhash_xlate.h (elf_cvt_gnuhash): Avoid post-increment in bswap_32
  1098. + argument, since some implementations are buggy macros.
  1099. +
  1100. 2011-02-26 Mark Wielaard <mjw@redhat.com>
  1101. * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
  1102. @@ -921,6 +926,11 @@
  1103. * elf.h: Update from glibc.
  1104. +2005-05-31 Roland McGrath <roland@redhat.com>
  1105. +
  1106. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  1107. + (AM_CFLAGS): Use it in place of -Wextra.
  1108. +
  1109. 2005-05-08 Roland McGrath <roland@redhat.com>
  1110. * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
  1111. --- elfutils/libelf/common.h
  1112. +++ elfutils/libelf/common.h
  1113. @@ -139,7 +139,7 @@ libelf_release_all (Elf *elf)
  1114. (Var) = (sizeof (Var) == 1 \
  1115. ? (unsigned char) (Var) \
  1116. : (sizeof (Var) == 2 \
  1117. - ? bswap_16 (Var) \
  1118. + ? (unsigned short int) bswap_16 (Var) \
  1119. : (sizeof (Var) == 4 \
  1120. ? bswap_32 (Var) \
  1121. : bswap_64 (Var))))
  1122. @@ -148,7 +148,7 @@ libelf_release_all (Elf *elf)
  1123. (Dst) = (sizeof (Var) == 1 \
  1124. ? (unsigned char) (Var) \
  1125. : (sizeof (Var) == 2 \
  1126. - ? bswap_16 (Var) \
  1127. + ? (unsigned short int) bswap_16 (Var) \
  1128. : (sizeof (Var) == 4 \
  1129. ? bswap_32 (Var) \
  1130. : bswap_64 (Var))))
  1131. --- elfutils/libelf/gnuhash_xlate.h
  1132. +++ elfutils/libelf/gnuhash_xlate.h
  1133. @@ -1,5 +1,5 @@
  1134. /* Conversion functions for versioning information.
  1135. - Copyright (C) 2006, 2007 Red Hat, Inc.
  1136. + Copyright (C) 2006-2011 Red Hat, Inc.
  1137. This file is part of elfutils.
  1138. Written by Ulrich Drepper <drepper@redhat.com>, 2006.
  1139. @@ -68,7 +68,9 @@ elf_cvt_gnuhash (void *dest, const void
  1140. dest32 = (Elf32_Word *) &dest64[bitmask_words];
  1141. while (len >= 4)
  1142. {
  1143. - *dest32++ = bswap_32 (*src32++);
  1144. + *dest32 = bswap_32 (*src32);
  1145. + ++dest32;
  1146. + ++src32;
  1147. len -= 4;
  1148. }
  1149. }
  1150. --- elfutils/libelf/Makefile.in
  1151. +++ elfutils/libelf/Makefile.in
  1152. @@ -84,9 +84,10 @@ DIST_COMMON = $(top_srcdir)/config/eu.am
  1153. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  1154. $(include_HEADERS) $(noinst_HEADERS) $(pkginclude_HEADERS) \
  1155. ChangeLog
  1156. -@BUILD_STATIC_TRUE@am__append_1 = -fpic
  1157. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  1158. +@BUILD_STATIC_TRUE@am__append_2 = -fpic
  1159. noinst_PROGRAMS = $(am__EXEEXT_1)
  1160. -@USE_LOCKS_TRUE@am__append_2 = -lpthread
  1161. +@USE_LOCKS_TRUE@am__append_3 = -lpthread
  1162. subdir = libelf
  1163. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  1164. am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
  1165. @@ -291,6 +292,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1166. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  1167. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  1168. LDFLAGS = @LDFLAGS@
  1169. +LD_AS_NEEDED = @LD_AS_NEEDED@
  1170. LEX = @LEX@
  1171. LEXLIB = @LEXLIB@
  1172. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  1173. @@ -322,6 +324,7 @@ SHELL = @SHELL@
  1174. STRIP = @STRIP@
  1175. USE_NLS = @USE_NLS@
  1176. VERSION = 1
  1177. +WEXTRA = @WEXTRA@
  1178. XGETTEXT = @XGETTEXT@
  1179. XGETTEXT_015 = @XGETTEXT_015@
  1180. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  1181. @@ -382,10 +385,11 @@ top_builddir = @top_builddir@
  1182. top_srcdir = @top_srcdir@
  1183. zip_LIBS = @zip_LIBS@
  1184. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
  1185. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 $(if \
  1186. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  1187. $($(*F)_no_Werror),,-Werror) $(if \
  1188. - $($(*F)_no_Wunused),,-Wunused -Wextra) $($(*F)_CFLAGS) \
  1189. - $(am__append_1)
  1190. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  1191. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  1192. + $(am__append_1) $(am__append_2)
  1193. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  1194. CLEANFILES = *.gcno *.gcda $(am_libelf_pic_a_OBJECTS) \
  1195. libelf.so.$(VERSION)
  1196. @@ -449,7 +453,7 @@ libelf_a_SOURCES = elf_version.c elf_has
  1197. libelf_pic_a_SOURCES =
  1198. am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
  1199. -libelf_so_LDLIBS = $(am__append_2)
  1200. +libelf_so_LDLIBS = $(am__append_3)
  1201. libelf_so_SOURCES =
  1202. noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
  1203. version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h
  1204. --- elfutils/m4/Makefile.in
  1205. +++ elfutils/m4/Makefile.in
  1206. @@ -145,6 +145,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1207. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  1208. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  1209. LDFLAGS = @LDFLAGS@
  1210. +LD_AS_NEEDED = @LD_AS_NEEDED@
  1211. LEX = @LEX@
  1212. LEXLIB = @LEXLIB@
  1213. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  1214. @@ -176,6 +177,7 @@ SHELL = @SHELL@
  1215. STRIP = @STRIP@
  1216. USE_NLS = @USE_NLS@
  1217. VERSION = @VERSION@
  1218. +WEXTRA = @WEXTRA@
  1219. XGETTEXT = @XGETTEXT@
  1220. XGETTEXT_015 = @XGETTEXT_015@
  1221. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  1222. --- elfutils/Makefile.in
  1223. +++ elfutils/Makefile.in
  1224. @@ -263,6 +263,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1225. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  1226. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  1227. LDFLAGS = @LDFLAGS@
  1228. +LD_AS_NEEDED = @LD_AS_NEEDED@
  1229. LEX = @LEX@
  1230. LEXLIB = @LEXLIB@
  1231. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  1232. @@ -294,6 +295,7 @@ SHELL = @SHELL@
  1233. STRIP = @STRIP@
  1234. USE_NLS = @USE_NLS@
  1235. VERSION = @VERSION@
  1236. +WEXTRA = @WEXTRA@
  1237. XGETTEXT = @XGETTEXT@
  1238. XGETTEXT_015 = @XGETTEXT_015@
  1239. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  1240. --- elfutils/src/addr2line.c
  1241. +++ elfutils/src/addr2line.c
  1242. @@ -540,10 +540,10 @@ handle_address (const char *string, Dwfl
  1243. bool parsed = false;
  1244. int i, j;
  1245. char *name = NULL;
  1246. - if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
  1247. + if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
  1248. && string[i] == '\0')
  1249. parsed = adjust_to_section (name, &addr, dwfl);
  1250. - switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
  1251. + switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
  1252. {
  1253. default:
  1254. break;
  1255. --- elfutils/src/ChangeLog
  1256. +++ elfutils/src/ChangeLog
  1257. @@ -1371,8 +1371,16 @@
  1258. * readelf.c (attr_callback): Use print_block only when we don't use
  1259. print_ops.
  1260. +2009-08-17 Roland McGrath <roland@redhat.com>
  1261. +
  1262. + * ld.h: Disable extern inlines for GCC 4.2.
  1263. +
  1264. 2009-08-14 Roland McGrath <roland@redhat.com>
  1265. + * strings.c (read_block): Conditionalize posix_fadvise use
  1266. + on [POSIX_FADV_SEQUENTIAL].
  1267. + From Petr Salinger <Petr.Salinger@seznam.cz>.
  1268. +
  1269. * ar.c (do_oper_extract): Use pathconf instead of statfs.
  1270. 2009-08-01 Ulrich Drepper <drepper@redhat.com>
  1271. @@ -1536,6 +1544,8 @@
  1272. * readelf.c (print_debug_frame_section): Use t instead of j formats
  1273. for ptrdiff_t OFFSET.
  1274. + * addr2line.c (handle_address): Use %a instead of %m for compatibility.
  1275. +
  1276. 2009-01-21 Ulrich Drepper <drepper@redhat.com>
  1277. * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
  1278. @@ -1719,6 +1729,11 @@
  1279. that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
  1280. is valid in RELRO.
  1281. +2008-03-01 Roland McGrath <roland@redhat.com>
  1282. +
  1283. + * readelf.c (dump_archive_index): Tweak portability hack
  1284. + to match [__GNUC__ < 4] too.
  1285. +
  1286. 2008-02-29 Roland McGrath <roland@redhat.com>
  1287. * readelf.c (print_attributes): Add a cast.
  1288. @@ -1970,6 +1985,8 @@
  1289. * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
  1290. + * Makefile.am (readelf_no_Werror): New variable.
  1291. +
  1292. 2007-10-15 Roland McGrath <roland@redhat.com>
  1293. * make-debug-archive.in: New file.
  1294. @@ -2409,6 +2426,10 @@
  1295. * elflint.c (valid_e_machine): Add EM_ALPHA.
  1296. Reported by Christian Aichinger <Greek0@gmx.net>.
  1297. + * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
  1298. + MADV_SEQUENTIAL if undefined. Don't call posix_madvise
  1299. + if neither is defined.
  1300. +
  1301. 2006-08-08 Ulrich Drepper <drepper@redhat.com>
  1302. * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
  1303. @@ -2485,6 +2506,10 @@
  1304. * Makefile.am: Add hacks to create dependency files for non-generic
  1305. linker.
  1306. +2006-04-05 Roland McGrath <roland@redhat.com>
  1307. +
  1308. + * strings.c (MAP_POPULATE): Define to 0 if undefined.
  1309. +
  1310. 2006-06-12 Ulrich Drepper <drepper@redhat.com>
  1311. * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
  1312. @@ -2833,6 +2858,11 @@
  1313. * readelf.c (print_debug_loc_section): Fix indentation for larger
  1314. address size.
  1315. +2005-05-31 Roland McGrath <roland@redhat.com>
  1316. +
  1317. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  1318. + (AM_CFLAGS): Use it in place of -Wextra.
  1319. +
  1320. 2005-05-30 Roland McGrath <roland@redhat.com>
  1321. * readelf.c (print_debug_line_section): Print section offset of each
  1322. --- elfutils/src/findtextrel.c
  1323. +++ elfutils/src/findtextrel.c
  1324. @@ -502,7 +502,11 @@ ptrcompare (const void *p1, const void *
  1325. static void
  1326. -check_rel (size_t nsegments, struct segments segments[nsegments],
  1327. +check_rel (size_t nsegments, struct segments segments[
  1328. +#if __GNUC__ >= 4
  1329. + nsegments
  1330. +#endif
  1331. + ],
  1332. GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
  1333. const char *fname, bool more_than_one, void **knownsrcs)
  1334. {
  1335. --- elfutils/src/ld.h
  1336. +++ elfutils/src/ld.h
  1337. @@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void);
  1338. /* Checked whether the symbol is undefined and referenced from a DSO. */
  1339. extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
  1340. +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
  1341. #ifdef __GNUC_STDC_INLINE__
  1342. __attribute__ ((__gnu_inline__))
  1343. #endif
  1344. @@ -1131,5 +1132,6 @@ linked_from_dso_p (struct scninfo *scnin
  1345. return sym->defined && sym->in_dso;
  1346. }
  1347. +#endif /* Optimizing and not GCC 4.2. */
  1348. #endif /* ld.h */
  1349. --- elfutils/src/Makefile.am
  1350. +++ elfutils/src/Makefile.am
  1351. @@ -89,6 +89,11 @@ endif
  1352. # XXX While the file is not finished, don't warn about this
  1353. ldgeneric_no_Wunused = yes
  1354. +# Buggy old compilers or libc headers.
  1355. +readelf_no_Werror = yes
  1356. +strings_no_Werror = yes
  1357. +addr2line_no_Wformat = yes
  1358. +
  1359. readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl
  1360. nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl \
  1361. $(demanglelib)
  1362. --- elfutils/src/Makefile.in
  1363. +++ elfutils/src/Makefile.in
  1364. @@ -85,6 +85,7 @@ DIST_COMMON = $(top_srcdir)/config/eu.am
  1365. $(srcdir)/Makefile.am ldlex.c ldscript.c \
  1366. $(top_srcdir)/config/depcomp $(top_srcdir)/config/ylwrap \
  1367. $(noinst_HEADERS) ChangeLog
  1368. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  1369. bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEEXT) size$(EXEEXT) \
  1370. strip$(EXEEXT) ld$(EXEEXT) elflint$(EXEEXT) \
  1371. findtextrel$(EXEEXT) addr2line$(EXEEXT) elfcmp$(EXEEXT) \
  1372. @@ -93,9 +94,9 @@ bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEE
  1373. @NATIVE_LD_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
  1374. # We never build this library but we need to get the dependency files
  1375. # of all the linker backends that might be used in a non-generic linker.
  1376. -@NEVER_TRUE@am__append_1 = libdummy.a
  1377. +@NEVER_TRUE@am__append_2 = libdummy.a
  1378. # -ldl is always needed for libebl.
  1379. -@NATIVE_LD_TRUE@am__append_2 = libld_elf.a
  1380. +@NATIVE_LD_TRUE@am__append_3 = libld_elf.a
  1381. @NATIVE_LD_TRUE@am_libld_elf_i386_pic_a_OBJECTS =
  1382. subdir = src
  1383. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  1384. @@ -159,7 +160,7 @@ am_ld_OBJECTS = ld.$(OBJEXT) ldgeneric.$
  1385. ldscript.$(OBJEXT) symbolhash.$(OBJEXT) sectionhash.$(OBJEXT) \
  1386. versionhash.$(OBJEXT)
  1387. ld_OBJECTS = $(am_ld_OBJECTS)
  1388. -ld_DEPENDENCIES = $(libebl) $(libelf) $(libeu) $(am__append_2)
  1389. +ld_DEPENDENCIES = $(libebl) $(libelf) $(libeu) $(am__append_3)
  1390. ld_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ld_LDFLAGS) $(LDFLAGS) -o \
  1391. $@
  1392. am_libld_elf_i386_so_OBJECTS =
  1393. @@ -340,6 +341,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1394. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  1395. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  1396. LDFLAGS = @LDFLAGS@
  1397. +LD_AS_NEEDED = @LD_AS_NEEDED@
  1398. LEX = @LEX@
  1399. LEXLIB = @LEXLIB@
  1400. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  1401. @@ -371,6 +373,7 @@ SHELL = @SHELL@
  1402. STRIP = @STRIP@
  1403. USE_NLS = @USE_NLS@
  1404. VERSION = @VERSION@
  1405. +WEXTRA = @WEXTRA@
  1406. XGETTEXT = @XGETTEXT@
  1407. XGETTEXT_015 = @XGETTEXT_015@
  1408. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  1409. @@ -434,11 +437,11 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_sr
  1410. -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
  1411. -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf \
  1412. -I$(srcdir)/../libdwfl -I$(srcdir)/../libasm
  1413. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
  1414. - $(if $($(*F)_no_Werror),,-Werror) \
  1415. - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
  1416. - $($(*F)_CFLAGS)
  1417. -
  1418. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  1419. + $($(*F)_no_Werror),,-Werror) $(if \
  1420. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  1421. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  1422. + $(am__append_1)
  1423. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  1424. CLEANFILES = *.gcno *.gcda make-debug-archive none_ld.os \
  1425. $(ld_modules:.c=.os) *.gconv
  1426. @@ -452,8 +455,8 @@ AM_LFLAGS = -Pld -olex.yy.c
  1427. native_ld = @native_ld@
  1428. ld_dsos = libld_elf_i386_pic.a
  1429. @NATIVE_LD_FALSE@noinst_LIBRARIES = libld_elf.a libar.a $(ld_dsos) \
  1430. -@NATIVE_LD_FALSE@ $(am__append_1)
  1431. -@NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a libar.a $(am__append_1)
  1432. +@NATIVE_LD_FALSE@ $(am__append_2)
  1433. +@NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a libar.a $(am__append_2)
  1434. @NATIVE_LD_TRUE@native_ld_cflags = -DBASE_ELF_NAME=elf_$(base_cpu)
  1435. @NEVER_TRUE@libdummy_a_SOURCES = i386_ld.c
  1436. ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \
  1437. @@ -479,13 +482,18 @@ libeu = ../lib/libeu.a
  1438. # XXX While the file is not finished, don't warn about this
  1439. ldgeneric_no_Wunused = yes
  1440. +
  1441. +# Buggy old compilers or libc headers.
  1442. +readelf_no_Werror = yes
  1443. +strings_no_Werror = yes
  1444. +addr2line_no_Wformat = yes
  1445. readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl
  1446. nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) -ldl \
  1447. $(demanglelib)
  1448. size_LDADD = $(libelf) $(libeu)
  1449. strip_LDADD = $(libebl) $(libelf) $(libeu) -ldl
  1450. -ld_LDADD = $(libebl) $(libelf) $(libeu) -ldl $(am__append_2)
  1451. +ld_LDADD = $(libebl) $(libelf) $(libeu) -ldl $(am__append_3)
  1452. ld_LDFLAGS = -rdynamic
  1453. elflint_LDADD = $(libebl) $(libelf) $(libeu) -ldl
  1454. findtextrel_LDADD = $(libdw) $(libelf)
  1455. --- elfutils/src/readelf.c
  1456. +++ elfutils/src/readelf.c
  1457. @@ -4368,10 +4368,12 @@ listptr_base (struct listptr *p)
  1458. return base;
  1459. }
  1460. +static const char *listptr_name;
  1461. +
  1462. static int
  1463. -compare_listptr (const void *a, const void *b, void *arg)
  1464. +compare_listptr (const void *a, const void *b)
  1465. {
  1466. - const char *name = arg;
  1467. + const char *const name = listptr_name;
  1468. struct listptr *p1 = (void *) a;
  1469. struct listptr *p2 = (void *) b;
  1470. @@ -4467,8 +4469,11 @@ static void
  1471. sort_listptr (struct listptr_table *table, const char *name)
  1472. {
  1473. if (table->n > 0)
  1474. - qsort_r (table->table, table->n, sizeof table->table[0],
  1475. - &compare_listptr, (void *) name);
  1476. + {
  1477. + listptr_name = name;
  1478. + qsort (table->table, table->n, sizeof table->table[0],
  1479. + &compare_listptr);
  1480. + }
  1481. }
  1482. static bool
  1483. @@ -9539,7 +9544,7 @@ dump_archive_index (Elf *elf, const char
  1484. if (unlikely (elf_rand (elf, as_off) == 0)
  1485. || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
  1486. == NULL))
  1487. -#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
  1488. +#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
  1489. while (1)
  1490. #endif
  1491. error (EXIT_FAILURE, 0,
  1492. --- elfutils/src/strings.c
  1493. +++ elfutils/src/strings.c
  1494. @@ -43,6 +43,10 @@
  1495. #include <system.h>
  1496. +#ifndef MAP_POPULATE
  1497. +# define MAP_POPULATE 0
  1498. +#endif
  1499. +
  1500. /* Prototypes of local functions. */
  1501. static int read_fd (int fd, const char *fname, off64_t fdlen);
  1502. @@ -489,8 +493,13 @@ map_file (int fd, off64_t start_off, off
  1503. fd, start_off);
  1504. if (mem != MAP_FAILED)
  1505. {
  1506. +#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
  1507. +# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
  1508. +#endif
  1509. +#ifdef POSIX_MADV_SEQUENTIAL
  1510. /* We will go through the mapping sequentially. */
  1511. (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
  1512. +#endif
  1513. break;
  1514. }
  1515. if (errno != EINVAL && errno != ENOMEM)
  1516. @@ -581,9 +590,11 @@ read_block (int fd, const char *fname, o
  1517. elfmap_off = from & ~(ps - 1);
  1518. elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
  1519. +#ifdef POSIX_FADV_SEQUENTIAL
  1520. if (unlikely (elfmap == MAP_FAILED))
  1521. /* Let the kernel know we are going to read everything in sequence. */
  1522. (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
  1523. +#endif
  1524. }
  1525. if (unlikely (elfmap == MAP_FAILED))
  1526. --- elfutils/src/strip.c
  1527. +++ elfutils/src/strip.c
  1528. @@ -45,6 +45,12 @@
  1529. #include <libebl.h>
  1530. #include <system.h>
  1531. +#ifdef HAVE_FUTIMES
  1532. +# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
  1533. +#else
  1534. +# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
  1535. +#endif
  1536. +
  1537. typedef uint8_t GElf_Byte;
  1538. /* Name and version of program. */
  1539. @@ -318,8 +324,18 @@ process_file (const char *fname)
  1540. /* If we have to preserve the timestamp, we need it in the
  1541. format utimes() understands. */
  1542. +#ifdef HAVE_STRUCT_STAT_ST_ATIM
  1543. TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
  1544. +#else
  1545. + tv[0].tv_sec = pre_st.st_atime;
  1546. + tv[0].tv_usec = 0;
  1547. +#endif
  1548. +#ifdef HAVE_STRUCT_STAT_ST_MTIM
  1549. TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
  1550. +#else
  1551. + tv[1].tv_sec = pre_st.st_atime;
  1552. + tv[1].tv_usec = 0;
  1553. +#endif
  1554. }
  1555. /* Open the file. */
  1556. @@ -2091,7 +2107,7 @@ while computing checksum for debug infor
  1557. /* If requested, preserve the timestamp. */
  1558. if (tvp != NULL)
  1559. {
  1560. - if (futimes (fd, tvp) != 0)
  1561. + if (FUTIMES (fd, output_fname, tvp) != 0)
  1562. {
  1563. error (0, errno, gettext ("\
  1564. cannot set access and modification date of '%s'"),
  1565. @@ -2148,7 +2164,7 @@ handle_ar (int fd, Elf *elf, const char
  1566. if (tvp != NULL)
  1567. {
  1568. - if (unlikely (futimes (fd, tvp) != 0))
  1569. + if (unlikely (FUTIMES (fd, fname, tvp) != 0))
  1570. {
  1571. error (0, errno, gettext ("\
  1572. cannot set access and modification date of '%s'"), fname);
  1573. --- elfutils/tests/backtrace.c
  1574. +++ elfutils/tests/backtrace.c
  1575. @@ -36,6 +36,7 @@
  1576. #include <fcntl.h>
  1577. #include <string.h>
  1578. #include <argp.h>
  1579. +#include <sys/syscall.h>
  1580. #include ELFUTILS_HEADER(dwfl)
  1581. #ifndef __linux__
  1582. --- elfutils/tests/ChangeLog
  1583. +++ elfutils/tests/ChangeLog
  1584. @@ -421,6 +421,13 @@
  1585. 2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com>
  1586. + Handle T-stopped detach for old kernels.
  1587. + * backtrace.c: Include sys/syscall.h.
  1588. + (linux_proc_pid_is_stopped): New function.
  1589. + (ptrace_detach_stopped): Handle old kernels.
  1590. +
  1591. +2013-12-02 Jan Kratochvil <jan.kratochvil@redhat.com>
  1592. +
  1593. * Makefile.am (check_PROGRAMS): Add backtrace, backtrace-child,
  1594. backtrace-data and backtrace-dwarf.
  1595. (BUILT_SOURCES, clean-local, backtrace-child-biarch): New.
  1596. @@ -1285,6 +1292,8 @@
  1597. 2008-01-21 Roland McGrath <roland@redhat.com>
  1598. + * line2addr.c (main): Revert last change.
  1599. +
  1600. * testfile45.S.bz2: Add tests for cltq, cqto.
  1601. * testfile45.expect.bz2: Adjust.
  1602. @@ -1993,6 +2002,11 @@
  1603. * Makefile.am (TESTS): Add run-elflint-test.sh.
  1604. (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
  1605. +2005-05-31 Roland McGrath <roland@redhat.com>
  1606. +
  1607. + * Makefile.am (WEXTRA): New variable, substituted by configure.
  1608. + (AM_CFLAGS): Use it in place of -Wextra.
  1609. +
  1610. 2005-05-24 Ulrich Drepper <drepper@redhat.com>
  1611. * get-files.c (main): Use correct format specifier.
  1612. --- elfutils/tests/line2addr.c
  1613. +++ elfutils/tests/line2addr.c
  1614. @@ -124,7 +124,7 @@ main (int argc, char *argv[])
  1615. {
  1616. struct args a = { .arg = argv[cnt] };
  1617. - switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
  1618. + switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
  1619. {
  1620. default:
  1621. case 0:
  1622. --- elfutils/tests/Makefile.am
  1623. +++ elfutils/tests/Makefile.am
  1624. @@ -365,6 +365,7 @@ get_lines_LDADD = $(libdw) $(libelf)
  1625. get_files_LDADD = $(libdw) $(libelf)
  1626. get_aranges_LDADD = $(libdw) $(libelf)
  1627. allfcts_LDADD = $(libdw) $(libelf)
  1628. +line2addr_no_Wformat = yes
  1629. line2addr_LDADD = $(libdw)
  1630. addrscopes_LDADD = $(libdw)
  1631. funcscopes_LDADD = $(libdw)
  1632. --- elfutils/tests/Makefile.in
  1633. +++ elfutils/tests/Makefile.in
  1634. @@ -80,13 +80,14 @@ host_triplet = @host@
  1635. DIST_COMMON = $(top_srcdir)/config/eu.am $(srcdir)/Makefile.in \
  1636. $(srcdir)/Makefile.am $(top_srcdir)/config/depcomp \
  1637. $(top_srcdir)/config/test-driver ChangeLog
  1638. -@STANDALONE_FALSE@am__append_1 = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
  1639. +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
  1640. +@STANDALONE_FALSE@am__append_2 = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
  1641. @STANDALONE_FALSE@ -I$(top_srcdir)/libdwfl -I$(top_srcdir)/libdwelf \
  1642. @STANDALONE_FALSE@ -I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
  1643. @STANDALONE_FALSE@ -I$(top_srcdir)/lib -I..
  1644. -@STANDALONE_FALSE@am__append_2 = -Wl,-rpath-link,../libasm:../libdw:../libelf
  1645. -@TESTS_RPATH_TRUE@am__append_3 = -Wl,-rpath,$(BUILD_RPATH)
  1646. +@STANDALONE_FALSE@am__append_3 = -Wl,-rpath-link,../libasm:../libdw:../libelf
  1647. +@TESTS_RPATH_TRUE@am__append_4 = -Wl,-rpath,$(BUILD_RPATH)
  1648. check_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \
  1649. newfile$(EXEEXT) saridx$(EXEEXT) scnnames$(EXEEXT) \
  1650. sectiondump$(EXEEXT) showptable$(EXEEXT) update1$(EXEEXT) \
  1651. @@ -113,7 +114,7 @@ check_PROGRAMS = arextract$(EXEEXT) arsy
  1652. deleted$(EXEEXT) deleted-lib.so$(EXEEXT) \
  1653. aggregate_size$(EXEEXT) vdsosyms$(EXEEXT) $(am__EXEEXT_1) \
  1654. $(am__EXEEXT_2) $(am__EXEEXT_4)
  1655. -@BIARCH_TRUE@am__append_4 = backtrace-child-biarch
  1656. +@BIARCH_TRUE@am__append_5 = backtrace-child-biarch
  1657. TESTS = run-arextract.sh run-arsymtest.sh newfile$(EXEEXT) \
  1658. test-nlist$(EXEEXT) update1$(EXEEXT) update2$(EXEEXT) \
  1659. update3$(EXEEXT) update4$(EXEEXT) run-show-die-info.sh \
  1660. @@ -159,14 +160,14 @@ TESTS = run-arextract.sh run-arsymtest.s
  1661. run-stack-i-test.sh run-readelf-dwz-multi.sh \
  1662. run-allfcts-multi.sh run-deleted.sh run-linkmap-cut.sh \
  1663. run-aggregate-size.sh vdsosyms$(EXEEXT) run-readelf-A.sh \
  1664. - $(am__EXEEXT_2) $(am__append_7) $(am__append_8) \
  1665. + $(am__EXEEXT_2) $(am__append_8) $(am__append_9) \
  1666. $(am__EXEEXT_4)
  1667. -@STANDALONE_FALSE@am__append_5 = msg_tst md5-sha1-test
  1668. @STANDALONE_FALSE@am__append_6 = msg_tst md5-sha1-test
  1669. -@LZMA_TRUE@am__append_7 = run-readelf-s.sh run-dwflsyms.sh
  1670. -@ZLIB_TRUE@am__append_8 = run-readelf-zdebug.sh
  1671. -@HAVE_LIBASM_TRUE@am__append_9 = $(asm_TESTS)
  1672. +@STANDALONE_FALSE@am__append_7 = msg_tst md5-sha1-test
  1673. +@LZMA_TRUE@am__append_8 = run-readelf-s.sh run-dwflsyms.sh
  1674. +@ZLIB_TRUE@am__append_9 = run-readelf-zdebug.sh
  1675. @HAVE_LIBASM_TRUE@am__append_10 = $(asm_TESTS)
  1676. +@HAVE_LIBASM_TRUE@am__append_11 = $(asm_TESTS)
  1677. subdir = tests
  1678. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  1679. am__aclocal_m4_deps = $(top_srcdir)/m4/biarch.m4 \
  1680. @@ -787,6 +788,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1681. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  1682. INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  1683. LDFLAGS = @LDFLAGS@
  1684. +LD_AS_NEEDED = @LD_AS_NEEDED@
  1685. LEX = @LEX@
  1686. LEXLIB = @LEXLIB@
  1687. LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  1688. @@ -818,6 +820,7 @@ SHELL = @SHELL@
  1689. STRIP = @STRIP@
  1690. USE_NLS = @USE_NLS@
  1691. VERSION = @VERSION@
  1692. +WEXTRA = @WEXTRA@
  1693. XGETTEXT = @XGETTEXT@
  1694. XGETTEXT_015 = @XGETTEXT_015@
  1695. XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
  1696. @@ -877,12 +880,12 @@ top_build_prefix = @top_build_prefix@
  1697. top_builddir = @top_builddir@
  1698. top_srcdir = @top_srcdir@
  1699. zip_LIBS = @zip_LIBS@
  1700. -AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_1)
  1701. -AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
  1702. - $(if $($(*F)_no_Werror),,-Werror) \
  1703. - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
  1704. - $($(*F)_CFLAGS)
  1705. -
  1706. +AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_2)
  1707. +AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
  1708. + $($(*F)_no_Werror),,-Werror) $(if \
  1709. + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
  1710. + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
  1711. + $(am__append_1)
  1712. COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
  1713. CLEANFILES = *.gcno *.gcda
  1714. textrel_msg = echo "WARNING: TEXTREL found in '$@'"
  1715. @@ -890,7 +893,7 @@ textrel_msg = echo "WARNING: TEXTREL fou
  1716. @FATAL_TEXTREL_TRUE@textrel_found = $(textrel_msg); exit 1
  1717. textrel_check = if $(READELF) -d $@ | fgrep -q TEXTREL; then $(textrel_found); fi
  1718. BUILD_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
  1719. -AM_LDFLAGS = $(am__append_2) $(am__append_3)
  1720. +AM_LDFLAGS = $(am__append_3) $(am__append_4)
  1721. @TESTS_RPATH_FALSE@tests_rpath = no
  1722. @TESTS_RPATH_TRUE@tests_rpath = yes
  1723. asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
  1724. @@ -1106,6 +1109,7 @@ get_lines_LDADD = $(libdw) $(libelf)
  1725. get_files_LDADD = $(libdw) $(libelf)
  1726. get_aranges_LDADD = $(libdw) $(libelf)
  1727. allfcts_LDADD = $(libdw) $(libelf)
  1728. +line2addr_no_Wformat = yes
  1729. line2addr_LDADD = $(libdw)
  1730. addrscopes_LDADD = $(libdw)
  1731. funcscopes_LDADD = $(libdw)