lol

ltrace: 0.7.3 -> 0.7.91

0.7.91 is a "fake" version of ltrace from Red Hat / Fedora which
includes many patches for better compatibility with non-x86
architectures as well as fixes for bugs found since the 0.7.3 release
back in 2013.

+386 -12
+45 -12
pkgs/development/tools/misc/ltrace/default.nix
··· 1 - { lib, stdenv, fetchurl, elfutils, libunwind }: 1 + { lib, stdenv, fetchurl, fetchgit, autoreconfHook, dejagnu, elfutils }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "ltrace"; 5 - version = "0.7.3"; 5 + version = "0.7.91"; 6 6 7 7 src = fetchurl { 8 - url = "mirror://debian/pool/main/l/${pname}/${pname}_${version}.orig.tar.bz2"; 9 - sha256 = "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"; 8 + url = "https://src.fedoraproject.org/repo/pkgs/ltrace/ltrace-0.7.91.tar.bz2/9db3bdee7cf3e11c87d8cc7673d4d25b/ltrace-0.7.91.tar.bz2"; 9 + sha256 = "sha256-HqellbKh2ZDHxslXl7SSIXtpjV1sodtgVwh8hgTC3Dc="; 10 10 }; 11 11 12 - buildInputs = [ elfutils libunwind ]; 12 + nativeBuildInputs = [ autoreconfHook ]; # Some patches impact ./configure. 13 + buildInputs = [ elfutils ]; 14 + checkInputs = [ dejagnu ]; 13 15 16 + # Import Fedora's (very) large patch series: bug fixes, architecture support, 17 + # etc. RH/Fedora are currently working with upstream to merge all these 18 + # patches for the next major branch. 14 19 prePatch = let 15 - debian = fetchurl { 16 - url = "mirror://debian/pool/main/l/ltrace/ltrace_0.7.3-6.debian.tar.xz"; 17 - sha256 = "0xc4pfd8qw53crvdxr29iwl8na53zmknca082kziwpvlzsick4kp"; 20 + fedora = fetchgit { 21 + url = "https://src.fedoraproject.org/rpms/ltrace.git"; 22 + rev = "00f430ccbebdbd13bdd4d7ee6303b091cf005542"; 23 + sha256 = "sha256-FBGEgmaslu7xrJtZ2WsYwu9Cw1ZQrWRV1+Eu9qLXO4s="; 18 24 }; 19 25 in '' 20 - tar xf '${debian}' 21 - patches="$patches $(cat debian/patches/series | sed 's|^|debian/patches/|')" 26 + # Order matters, read the patch list from the RPM spec. Our own patches 27 + # are applied on top of the Fedora baseline. 28 + fedorapatches="" 29 + for p in $(grep '^Patch[0-9]\+:' ${fedora}/ltrace.spec | awk '{ print $2 }'); do 30 + fedorapatches="$fedorapatches ${fedora}/$p" 31 + done 32 + patches="$fedorapatches $patches" 22 33 ''; 23 34 35 + # Cherry-pick extra patches for recent glibc support in the test suite. 36 + patches = [ 37 + # https://gitlab.com/cespedes/ltrace/-/merge_requests/14 38 + ./testsuite-newfstatat.patch 39 + # https://gitlab.com/cespedes/ltrace/-/merge_requests/15 40 + ./sysdeps-x86.patch 41 + ]; 42 + 43 + doCheck = true; 44 + checkPhase = '' 45 + # Hardening options interfere with some of the low-level expectations in 46 + # the test suite (e.g. printf ends up redirected to __printf_chk). 47 + NIX_HARDENING_ENABLE="" \ 48 + # Disable test that requires ptrace-ing a non-child process, this might be 49 + # forbidden by YAMA ptrace policy on the build host. 50 + RUNTESTFLAGS="--host=${stdenv.hostPlatform.config} \ 51 + --target=${stdenv.targetPlatform.config} \ 52 + --ignore attach-process.exp" \ 53 + make check 54 + ''; 55 + 24 56 meta = with lib; { 25 57 description = "Library call tracer"; 26 58 homepage = "https://www.ltrace.org/"; 27 - platforms = [ "i686-linux" "x86_64-linux" ]; 28 - license = licenses.gpl2; 59 + platforms = platforms.linux; 60 + license = licenses.gpl2Plus; 61 + maintainers = with maintainers; [ delroth ]; 29 62 }; 30 63 }
+328
pkgs/development/tools/misc/ltrace/sysdeps-x86.patch
··· 1 + diff --git a/sysdeps/linux-gnu/x86/syscallent.h b/sysdeps/linux-gnu/x86/syscallent.h 2 + index 345fe20..66ac522 100644 3 + --- a/sysdeps/linux-gnu/x86/syscallent.h 4 + +++ b/sysdeps/linux-gnu/x86/syscallent.h 5 + @@ -238,7 +238,7 @@ 6 + "setfsgid32", /* 216 */ 7 + "pivot_root", /* 217 */ 8 + "mincore", /* 218 */ 9 + - "madvise1", /* 219 */ 10 + + "madvise", /* 219 */ 11 + "getdents64", /* 220 */ 12 + "fcntl64", /* 221 */ 13 + "222", /* 222 */ 14 + @@ -279,14 +279,14 @@ 15 + "remap_file_pages", /* 257 */ 16 + "set_tid_address", /* 258 */ 17 + "timer_create", /* 259 */ 18 + - "260", /* 260 */ 19 + - "261", /* 261 */ 20 + - "262", /* 262 */ 21 + - "263", /* 263 */ 22 + - "264", /* 264 */ 23 + - "265", /* 265 */ 24 + - "266", /* 266 */ 25 + - "267", /* 267 */ 26 + + "timer_settime", /* 260 */ 27 + + "timer_gettime", /* 261 */ 28 + + "timer_getoverrun", /* 262 */ 29 + + "timer_delete", /* 263 */ 30 + + "clock_settime", /* 264 */ 31 + + "clock_gettime", /* 265 */ 32 + + "clock_getres", /* 266 */ 33 + + "clock_nanosleep", /* 267 */ 34 + "statfs64", /* 268 */ 35 + "fstatfs64", /* 269 */ 36 + "tgkill", /* 270 */ 37 + @@ -297,11 +297,11 @@ 38 + "get_mempolicy", /* 275 */ 39 + "set_mempolicy", /* 276 */ 40 + "mq_open", /* 277 */ 41 + - "278", /* 278 */ 42 + - "279", /* 279 */ 43 + - "280", /* 280 */ 44 + - "281", /* 281 */ 45 + - "282", /* 282 */ 46 + + "mq_unlink", /* 278 */ 47 + + "mq_timedsend", /* 279 */ 48 + + "mq_timedreceive", /* 280 */ 49 + + "mq_notify", /* 281 */ 50 + + "mq_getsetattr", /* 282 */ 51 + "kexec_load", /* 283 */ 52 + "waitid", /* 284 */ 53 + "285", /* 285 */ 54 + @@ -368,3 +368,105 @@ 55 + "setns", /* 346 */ 56 + "process_vm_readv", /* 347 */ 57 + "process_vm_writev", /* 348 */ 58 + + "kcmp", /* 349 */ 59 + + "finit_module", /* 350 */ 60 + + "sched_setattr", /* 351 */ 61 + + "sched_getattr", /* 352 */ 62 + + "renameat2", /* 353 */ 63 + + "seccomp", /* 354 */ 64 + + "getrandom", /* 355 */ 65 + + "memfd_create", /* 356 */ 66 + + "bpf", /* 357 */ 67 + + "execveat", /* 358 */ 68 + + "socket", /* 359 */ 69 + + "socketpair", /* 360 */ 70 + + "bind", /* 361 */ 71 + + "connect", /* 362 */ 72 + + "listen", /* 363 */ 73 + + "accept4", /* 364 */ 74 + + "getsockopt", /* 365 */ 75 + + "setsockopt", /* 366 */ 76 + + "getsockname", /* 367 */ 77 + + "getpeername", /* 368 */ 78 + + "sendto", /* 369 */ 79 + + "sendmsg", /* 370 */ 80 + + "recvfrom", /* 371 */ 81 + + "recvmsg", /* 372 */ 82 + + "shutdown", /* 373 */ 83 + + "userfaultfd", /* 374 */ 84 + + "membarrier", /* 375 */ 85 + + "mlock2", /* 376 */ 86 + + "copy_file_range", /* 377 */ 87 + + "preadv2", /* 378 */ 88 + + "pwritev2", /* 379 */ 89 + + "pkey_mprotect", /* 380 */ 90 + + "pkey_alloc", /* 381 */ 91 + + "pkey_free", /* 382 */ 92 + + "statx", /* 383 */ 93 + + "arch_prctl", /* 384 */ 94 + + "io_pgetevents", /* 385 */ 95 + + "rseq", /* 386 */ 96 + + "387", /* 387 */ 97 + + "388", /* 388 */ 98 + + "389", /* 389 */ 99 + + "390", /* 390 */ 100 + + "391", /* 391 */ 101 + + "392", /* 392 */ 102 + + "semget", /* 393 */ 103 + + "semctl", /* 394 */ 104 + + "shmget", /* 395 */ 105 + + "shmctl", /* 396 */ 106 + + "shmat", /* 397 */ 107 + + "shmdt", /* 398 */ 108 + + "msgget", /* 399 */ 109 + + "msgsnd", /* 400 */ 110 + + "msgrcv", /* 401 */ 111 + + "msgctl", /* 402 */ 112 + + "clock_gettime64", /* 403 */ 113 + + "clock_settime64", /* 404 */ 114 + + "clock_adjtime64", /* 405 */ 115 + + "clock_getres_time64", /* 406 */ 116 + + "clock_nanosleep_time64", /* 407 */ 117 + + "timer_gettime64", /* 408 */ 118 + + "timer_settime64", /* 409 */ 119 + + "timerfd_gettime64", /* 410 */ 120 + + "timerfd_settime64", /* 411 */ 121 + + "utimensat_time64", /* 412 */ 122 + + "pselect6_time64", /* 413 */ 123 + + "ppoll_time64", /* 414 */ 124 + + "415", /* 415 */ 125 + + "io_pgetevents_time64", /* 416 */ 126 + + "recvmmsg_time64", /* 417 */ 127 + + "mq_timedsend_time64", /* 418 */ 128 + + "mq_timedreceive_time64", /* 419 */ 129 + + "semtimedop_time64", /* 420 */ 130 + + "rt_sigtimedwait_time64", /* 421 */ 131 + + "futex_time64", /* 422 */ 132 + + "sched_rr_get_interval_time64", /* 423 */ 133 + + "pidfd_send_signal", /* 424 */ 134 + + "io_uring_setup", /* 425 */ 135 + + "io_uring_enter", /* 426 */ 136 + + "io_uring_register", /* 427 */ 137 + + "open_tree", /* 428 */ 138 + + "move_mount", /* 429 */ 139 + + "fsopen", /* 430 */ 140 + + "fsconfig", /* 431 */ 141 + + "fsmount", /* 432 */ 142 + + "fspick", /* 433 */ 143 + + "pidfd_open", /* 434 */ 144 + + "clone3", /* 435 */ 145 + + "close_range", /* 436 */ 146 + + "openat2", /* 437 */ 147 + + "pidfd_getfd", /* 438 */ 148 + + "faccessat2", /* 439 */ 149 + + "process_madvise", /* 440 */ 150 + + "epoll_pwait2", /* 441 */ 151 + + "mount_setattr", /* 442 */ 152 + + "quotactl_fd", /* 443 */ 153 + + "landlock_create_ruleset", /* 444 */ 154 + + "landlock_add_rule", /* 445 */ 155 + + "landlock_restrict_self", /* 446 */ 156 + + "memfd_secret", /* 447 */ 157 + + "process_mrelease", /* 448 */ 158 + + "futex_waitv", /* 449 */ 159 + + "set_mempolicy_home_node", /* 450 */ 160 + diff --git a/sysdeps/linux-gnu/x86/syscallent1.h b/sysdeps/linux-gnu/x86/syscallent1.h 161 + index 91ae8d6..f8b15f7 100644 162 + --- a/sysdeps/linux-gnu/x86/syscallent1.h 163 + +++ b/sysdeps/linux-gnu/x86/syscallent1.h 164 + @@ -36,8 +36,8 @@ 165 + "rt_sigprocmask", /* 14 */ 166 + "rt_sigreturn", /* 15 */ 167 + "ioctl", /* 16 */ 168 + - "pread", /* 17 */ 169 + - "pwrite", /* 18 */ 170 + + "pread64", /* 17 */ 171 + + "pwrite64", /* 18 */ 172 + "readv", /* 19 */ 173 + "writev", /* 20 */ 174 + "access", /* 21 */ 175 + @@ -233,8 +233,8 @@ 176 + "get_thread_area", /* 211 */ 177 + "lookup_dcookie", /* 212 */ 178 + "epoll_create", /* 213 */ 179 + - "epoll_ctl", /* 214 */ 180 + - "epoll_wait", /* 215 */ 181 + + "epoll_ctl_old", /* 214 */ 182 + + "epoll_wait_old", /* 215 */ 183 + "remap_file_pages", /* 216 */ 184 + "getdents64", /* 217 */ 185 + "set_tid_address", /* 218 */ 186 + @@ -331,3 +331,142 @@ 187 + "getcpu", /* 309 */ 188 + "process_vm_readv", /* 310 */ 189 + "process_vm_writev", /* 311 */ 190 + + "kcmp", /* 312 */ 191 + + "finit_module", /* 313 */ 192 + + "sched_setattr", /* 314 */ 193 + + "sched_getattr", /* 315 */ 194 + + "renameat2", /* 316 */ 195 + + "seccomp", /* 317 */ 196 + + "getrandom", /* 318 */ 197 + + "memfd_create", /* 319 */ 198 + + "kexec_file_load", /* 320 */ 199 + + "bpf", /* 321 */ 200 + + "execveat", /* 322 */ 201 + + "userfaultfd", /* 323 */ 202 + + "membarrier", /* 324 */ 203 + + "mlock2", /* 325 */ 204 + + "copy_file_range", /* 326 */ 205 + + "preadv2", /* 327 */ 206 + + "pwritev2", /* 328 */ 207 + + "pkey_mprotect", /* 329 */ 208 + + "pkey_alloc", /* 330 */ 209 + + "pkey_free", /* 331 */ 210 + + "statx", /* 332 */ 211 + + "io_pgetevents", /* 333 */ 212 + + "rseq", /* 334 */ 213 + + "335", /* 335 */ 214 + + "336", /* 336 */ 215 + + "337", /* 337 */ 216 + + "338", /* 338 */ 217 + + "339", /* 339 */ 218 + + "340", /* 340 */ 219 + + "341", /* 341 */ 220 + + "342", /* 342 */ 221 + + "343", /* 343 */ 222 + + "344", /* 344 */ 223 + + "345", /* 345 */ 224 + + "346", /* 346 */ 225 + + "347", /* 347 */ 226 + + "348", /* 348 */ 227 + + "349", /* 349 */ 228 + + "350", /* 350 */ 229 + + "351", /* 351 */ 230 + + "352", /* 352 */ 231 + + "353", /* 353 */ 232 + + "354", /* 354 */ 233 + + "355", /* 355 */ 234 + + "356", /* 356 */ 235 + + "357", /* 357 */ 236 + + "358", /* 358 */ 237 + + "359", /* 359 */ 238 + + "360", /* 360 */ 239 + + "361", /* 361 */ 240 + + "362", /* 362 */ 241 + + "363", /* 363 */ 242 + + "364", /* 364 */ 243 + + "365", /* 365 */ 244 + + "366", /* 366 */ 245 + + "367", /* 367 */ 246 + + "368", /* 368 */ 247 + + "369", /* 369 */ 248 + + "370", /* 370 */ 249 + + "371", /* 371 */ 250 + + "372", /* 372 */ 251 + + "373", /* 373 */ 252 + + "374", /* 374 */ 253 + + "375", /* 375 */ 254 + + "376", /* 376 */ 255 + + "377", /* 377 */ 256 + + "378", /* 378 */ 257 + + "379", /* 379 */ 258 + + "380", /* 380 */ 259 + + "381", /* 381 */ 260 + + "382", /* 382 */ 261 + + "383", /* 383 */ 262 + + "384", /* 384 */ 263 + + "385", /* 385 */ 264 + + "386", /* 386 */ 265 + + "387", /* 387 */ 266 + + "388", /* 388 */ 267 + + "389", /* 389 */ 268 + + "390", /* 390 */ 269 + + "391", /* 391 */ 270 + + "392", /* 392 */ 271 + + "393", /* 393 */ 272 + + "394", /* 394 */ 273 + + "395", /* 395 */ 274 + + "396", /* 396 */ 275 + + "397", /* 397 */ 276 + + "398", /* 398 */ 277 + + "399", /* 399 */ 278 + + "400", /* 400 */ 279 + + "401", /* 401 */ 280 + + "402", /* 402 */ 281 + + "403", /* 403 */ 282 + + "404", /* 404 */ 283 + + "405", /* 405 */ 284 + + "406", /* 406 */ 285 + + "407", /* 407 */ 286 + + "408", /* 408 */ 287 + + "409", /* 409 */ 288 + + "410", /* 410 */ 289 + + "411", /* 411 */ 290 + + "412", /* 412 */ 291 + + "413", /* 413 */ 292 + + "414", /* 414 */ 293 + + "415", /* 415 */ 294 + + "416", /* 416 */ 295 + + "417", /* 417 */ 296 + + "418", /* 418 */ 297 + + "419", /* 419 */ 298 + + "420", /* 420 */ 299 + + "421", /* 421 */ 300 + + "422", /* 422 */ 301 + + "423", /* 423 */ 302 + + "pidfd_send_signal", /* 424 */ 303 + + "io_uring_setup", /* 425 */ 304 + + "io_uring_enter", /* 426 */ 305 + + "io_uring_register", /* 427 */ 306 + + "open_tree", /* 428 */ 307 + + "move_mount", /* 429 */ 308 + + "fsopen", /* 430 */ 309 + + "fsconfig", /* 431 */ 310 + + "fsmount", /* 432 */ 311 + + "fspick", /* 433 */ 312 + + "pidfd_open", /* 434 */ 313 + + "clone3", /* 435 */ 314 + + "close_range", /* 436 */ 315 + + "openat2", /* 437 */ 316 + + "pidfd_getfd", /* 438 */ 317 + + "faccessat2", /* 439 */ 318 + + "process_madvise", /* 440 */ 319 + + "epoll_pwait2", /* 441 */ 320 + + "mount_setattr", /* 442 */ 321 + + "quotactl_fd", /* 443 */ 322 + + "landlock_create_ruleset", /* 444 */ 323 + + "landlock_add_rule", /* 445 */ 324 + + "landlock_restrict_self", /* 446 */ 325 + + "memfd_secret", /* 447 */ 326 + + "process_mrelease", /* 448 */ 327 + + "futex_waitv", /* 449 */ 328 + + "set_mempolicy_home_node", /* 450 */
+13
pkgs/development/tools/misc/ltrace/testsuite-newfstatat.patch
··· 1 + diff --git a/testsuite/ltrace.main/system_calls.exp b/testsuite/ltrace.main/system_calls.exp 2 + index 1b64cb0..af19916 100644 3 + --- a/testsuite/ltrace.main/system_calls.exp 4 + +++ b/testsuite/ltrace.main/system_calls.exp 5 + @@ -133,7 +133,7 @@ Match [Diff [Calls [ltraceRun -L -S -- $bin]] \ 6 + { {^write$} == 1 } 7 + { {^unlink(at)?$} >= 2 } 8 + { {^open(at)?$} == 1 } 9 + - { {^(new|f)?stat(64)?$} >= 1 } 10 + + { {^(new)?f?statx?(at)?(64)?$} >= 1 } 11 + { {^close$} == 1 } 12 + { {^getcwd$} == 1 } 13 + { {^chdir$} == 1 }