001-elfutils-portability.patch 68 KB

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