various: fix build with GCC 14 (#357774)

This commit is contained in:
Emily
2024-11-25 11:45:55 +00:00
committed by GitHub
10 changed files with 72 additions and 244 deletions
@@ -8,6 +8,7 @@
, alsa-lib
, faac
, faad2
, fetchpatch
, ffmpeg
, glib
, openh264
@@ -85,6 +86,22 @@ stdenv.mkDerivation rec {
hash = "sha256-w+xyMNFmKylSheK0yAGl8J6MXly/HUjjAfR9Qq3s/kA=";
};
patches = [
# GCC 14 compatibility
(fetchpatch {
url = "https://github.com/FreeRDP/FreeRDP/commit/5b14b7cbdd36414f1838047f21502654bd32ebb1.patch";
hash = "sha256-EWLfmjGJGWA/sY2E2DnFKhPbzhOVbXZPCrV8i1XuSeY=";
})
(fetchpatch {
url = "https://github.com/FreeRDP/FreeRDP/commit/efa899d3deb8595a29fabb2a2251722f9d7e0d7f.patch";
hash = "sha256-hjqNexYq+3iO2L2L9wT2tWbHz0BEtl/y7jgQT4kpNIM=";
})
(fetchpatch {
url = "https://github.com/FreeRDP/FreeRDP/commit/0c20fac8f1deeeca3df93a6619542e5d9176f0f0.patch";
hash = "sha256-cEzNPteucoI5KoGEM3C6mg2kW9uWImPebZEV6nssexY=";
})
];
postPatch = ''
export HOME=$TMP
@@ -1,11 +0,0 @@
--- a/genisoimage/genisoimage.h
+++ b/genisoimage/genisoimage.h
@@ -377,7 +377,7 @@ extern int use_fileversion;
extern int split_SL_component;
extern int split_SL_field;
extern char *trans_tbl;
-char *outfile;
+extern char *outfile;
#define JMAX 64 /* maximum Joliet file name length (spec) */
#define JLONGMAX 103 /* out of spec Joliet file name length */
@@ -1,204 +0,0 @@
diff --git a/doc/icedax/tracknames.pl b/doc/icedax/tracknames.pl
old mode 100755
new mode 100644
index 09f0fcf..801b89e
--- a/doc/icedax/tracknames.pl
+++ b/doc/icedax/tracknames.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# A quick perl hack to get rename files pulled in with icedax.
# by billo@billo.com
#
diff --git a/genisoimage/eltorito.c b/genisoimage/eltorito.c
index b97bdf1..5d7c2d1 100644
--- a/genisoimage/eltorito.c
+++ b/genisoimage/eltorito.c
@@ -59,7 +59,7 @@ static void get_torito_desc(struct eltorito_boot_descriptor *boot_desc);
static void fill_boot_desc(struct eltorito_defaultboot_entry *boot_desc_entry,
struct eltorito_boot_entry_info *boot_entry);
void get_boot_entry(void);
-void new_boot_entry(void);
+void new_boot_entry();
static int tvd_write(FILE *outfile);
@@ -283,6 +283,7 @@ get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
int i;
int offset;
struct eltorito_defaultboot_entry boot_desc_record;
+ struct eltorito_sectionheader_entry section_header;
memset(boot_desc, 0, sizeof (*boot_desc));
boot_desc->type[0] = 0;
@@ -317,7 +318,7 @@ get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
*/
memset(&valid_desc, 0, sizeof (valid_desc));
valid_desc.headerid[0] = 1;
- valid_desc.arch[0] = EL_TORITO_ARCH_x86;
+ valid_desc.arch[0] = first_boot_entry->arch;
/*
* we'll shove start of publisher id into id field,
@@ -347,10 +348,53 @@ get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
/* now write it to the virtual boot catalog */
memcpy(de2->table, &valid_desc, 32);
- for (current_boot_entry = first_boot_entry, offset = sizeof (valid_desc);
- current_boot_entry != NULL;
- current_boot_entry = current_boot_entry->next,
- offset += sizeof (boot_desc_record)) {
+ /* Fill the first entry, since it's special and already has the
+ * matching header via the validation header... */
+ offset = sizeof (valid_desc);
+ current_boot_entry = first_boot_entry;
+
+ if (offset >= SECTOR_SIZE) {
+#ifdef USE_LIBSCHILY
+ comerrno(EX_BAD, "Too many El Torito boot entries\n");
+#else
+ fprintf(stderr, "Too many El Torito boot entries\n");
+ exit(1);
+#endif
+ }
+ fill_boot_desc(&boot_desc_record, current_boot_entry);
+ memcpy(de2->table + offset, &boot_desc_record,
+ sizeof (boot_desc_record));
+
+ offset += sizeof(boot_desc_record);
+
+ for (current_boot_entry = current_boot_entry->next;
+ current_boot_entry != NULL;
+ current_boot_entry = current_boot_entry->next) {
+ struct eltorito_sectionheader_entry section_header;
+
+ if (offset >= SECTOR_SIZE) {
+#ifdef USE_LIBSCHILY
+ comerrno(EX_BAD,
+ "Too many El Torito boot entries\n");
+#else
+ fprintf(stderr,
+ "Too many El Torito boot entries\n");
+ exit(1);
+#endif
+ }
+
+ memset(&section_header, '\0', sizeof(section_header));
+ if (current_boot_entry->next)
+ section_header.headerid[0] = EL_TORITO_SECTION_HEADER;
+ else
+ section_header.headerid[0] = EL_TORITO_LAST_SECTION_HEADER;
+
+ section_header.arch[0] = current_boot_entry->arch;
+ set_721(section_header.num_entries, 1);
+
+ memcpy(de2->table + offset, &section_header,
+ sizeof(section_header));
+ offset += sizeof(section_header);
if (offset >= SECTOR_SIZE) {
#ifdef USE_LIBSCHILY
@@ -365,6 +409,8 @@ get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
fill_boot_desc(&boot_desc_record, current_boot_entry);
memcpy(de2->table + offset, &boot_desc_record,
sizeof (boot_desc_record));
+ offset += sizeof (boot_desc_record);
+
}
}/* get_torito_desc(... */
diff --git a/genisoimage/genisoimage.c b/genisoimage/genisoimage.c
index a5b0b46..8add1ac 100644
--- a/genisoimage/genisoimage.c
+++ b/genisoimage/genisoimage.c
@@ -47,6 +47,7 @@
#include <mconfig.h>
#include "genisoimage.h"
+#include "iso9660.h"
#include <errno.h>
#include <timedefs.h>
#include <fctldefs.h>
@@ -523,6 +524,8 @@ static const struct ld_option ld_options[] =
'\0', NULL, "Set debug flag", ONE_DASH},
{{"eltorito-boot", required_argument, NULL, 'b'},
'b', "FILE", "Set El Torito boot image name", ONE_DASH},
+ {{"efi-boot", required_argument, NULL, 'e'},
+ 'e', "FILE", "Set EFI boot image name", ONE_DASH},
{{"eltorito-alt-boot", no_argument, NULL, OPTION_ALT_BOOT},
'\0', NULL, "Start specifying alternative El Torito boot parameters", ONE_DASH},
{{"sparc-boot", required_argument, NULL, 'B'},
@@ -1502,6 +1505,7 @@ int main(int argc, char *argv[])
all_files = 0;
break;
case 'b':
+ case 'e':
do_sort++; /* We sort bootcat/botimage */
use_eltorito++;
boot_image = optarg; /* pathname of the boot image */
@@ -1517,6 +1521,10 @@ int main(int argc, char *argv[])
#endif
}
get_boot_entry();
+ if (c == 'e')
+ current_boot_entry->arch = EL_TORITO_ARCH_EFI;
+ else
+ current_boot_entry->arch = EL_TORITO_ARCH_x86;
current_boot_entry->boot_image = boot_image;
break;
case OPTION_ALT_BOOT:
diff --git a/genisoimage/genisoimage.h b/genisoimage/genisoimage.h
index bbedfb0..76e5e21 100644
--- a/genisoimage/genisoimage.h
+++ b/genisoimage/genisoimage.h
@@ -293,6 +293,7 @@ struct deferred_write {
struct eltorito_boot_entry_info {
struct eltorito_boot_entry_info *next;
char *boot_image;
+ char arch;
int not_bootable;
int no_emul_boot;
int hard_disk_boot;
diff --git a/genisoimage/iso9660.h b/genisoimage/iso9660.h
index c74c2a9..c8b7a05 100644
--- a/genisoimage/iso9660.h
+++ b/genisoimage/iso9660.h
@@ -62,10 +62,14 @@ struct iso_volume_descriptor {
#define EL_TORITO_ARCH_x86 0
#define EL_TORITO_ARCH_PPC 1
#define EL_TORITO_ARCH_MAC 2
+#define EL_TORITO_ARCH_EFI 0xef
#define EL_TORITO_BOOTABLE 0x88
#define EL_TORITO_NOT_BOOTABLE 0
+#define EL_TORITO_SECTION_HEADER 0x90
+#define EL_TORITO_LAST_SECTION_HEADER 0x91
+
#define EL_TORITO_MEDIA_NOEMUL 0
#define EL_TORITO_MEDIA_12FLOP 1
#define EL_TORITO_MEDIA_144FLOP 2
@@ -173,7 +177,7 @@ struct eltorito_validation_entry {
struct eltorito_defaultboot_entry {
char boot_id [ISODCL(1, 1)]; /* 711 */
char boot_media [ISODCL(2, 2)];
- char loadseg [ISODCL(3, 4)]; /* 711 */
+ char loadseg [ISODCL(3, 4)]; /* 712 */
char sys_type [ISODCL(5, 5)];
char pad1 [ISODCL(6, 6)];
char nsect [ISODCL(7, 8)];
@@ -181,6 +185,14 @@ struct eltorito_defaultboot_entry {
char pad2 [ISODCL(13, 32)];
};
+/* El Torito Section Header Entry in boot catalog */
+struct eltorito_sectionheader_entry {
+ char headerid [ISODCL(1, 1)]; /* 711 */
+ char arch [ISODCL(2, 2)];
+ char num_entries [ISODCL(3, 4)]; /* 711 */
+ char id [ISODCL(5, 32)];
+};
+
/*
* XXX JS: The next two structures have odd lengths!
* Some compilers (e.g. on Sun3/mc68020) padd the structures to even length.
@@ -1,9 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57edba6..d06b6d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,4 @@
PROJECT (cdrkit C)
+INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include)
SUBDIRS(include genisoimage wodim libedc libhfs_iso libparanoia icedax libusal librols libunls readom netscsid 3rd-party/dirsplit)
+14 -14
View File
@@ -1,30 +1,30 @@
{lib, stdenv, fetchurl, cmake, libcap, zlib, bzip2, perl}:
{lib, stdenv, fetchFromGitLab, cmake, libcap, zlib, bzip2, perl, quilt}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "cdrkit";
version = "1.1.11";
version = "1.1.11-3.5";
src = fetchurl {
url = "http://cdrkit.org/releases/cdrkit-${version}.tar.gz";
sha256 = "1nj7iv3xrq600i37na9a5idd718piiiqbs4zxvpjs66cdrsk1h6i";
src = fetchFromGitLab {
domain = "salsa.debian.org";
owner = "debian";
repo = "cdrkit";
rev = "debian/9%${finalAttrs.version}";
hash = "sha256-T7WhztbpVvGegF6rTHGTkEALq+mcAtTerzDQ3f6Cq78=";
};
nativeBuildInputs = [ cmake ];
nativeBuildInputs = [ cmake quilt ];
buildInputs = [ zlib bzip2 perl ] ++
lib.optionals stdenv.hostPlatform.isLinux [ libcap ];
hardeningDisable = [ "format" ];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.hostPlatform.isMusl [
"-D__THROW="
] ++ lib.optionals stdenv.cc.isClang [
"-Wno-error=int-conversion"
"-Wno-error=implicit-function-declaration"
]);
# efi-boot-patch extracted from http://arm.koji.fedoraproject.org/koji/rpminfo?rpmID=174244
patches = [ ./include-path.patch ./cdrkit-1.1.9-efi-boot.patch ./cdrkit-1.1.11-fno-common.patch ];
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
postPatch = ''
QUILT_PATCHES=debian/patches quilt push -a
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace libusal/scsi-mac-iokit.c \
--replace "IOKit/scsi-commands/SCSITaskLib.h" "IOKit/scsi/SCSITaskLib.h"
substituteInPlace genisoimage/sha256.c \
@@ -75,4 +75,4 @@ stdenv.mkDerivation rec {
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
};
}
})
@@ -3,6 +3,7 @@
stdenv,
buildPythonPackage,
fetchPypi,
fetchpatch,
pytestCheckHook,
pythonOlder,
@@ -26,6 +27,14 @@ buildPythonPackage rec {
hash = "sha256-mX9hWbFIQFnsI5ysqlNGf9i1Vk2r4YbNhKwpRGY7C/Y=";
};
patches = [
# fixes build error with GCC 14
(fetchpatch {
url = "https://github.com/shapely/shapely/commit/05455886750680728dc751dc5888cd02086d908e.patch";
hash = "sha256-YnmiWFfjHHFZCxrmabBINM4phqfLQ+6xEc30EoV5d98=";
})
];
nativeBuildInputs = [
cython_0
geos # for geos-config
@@ -1,6 +1,7 @@
{
lib,
fetchPypi,
fetchpatch,
buildPythonPackage,
pytestCheckHook,
libxslt,
@@ -24,6 +25,14 @@ buildPythonPackage rec {
hash = "sha256-k0+ATy+JW824bx6u4ja2YQE1YO5p7BCNKc3W5fKSotk=";
};
patches = [
# fixes build error with GCC 14
(fetchpatch {
url = "https://github.com/xmlsec/python-xmlsec/commit/67cd4ac73e4fceac4b4eb6a320067cad33f79213.patch";
hash = "sha256-zU34a2x3S48Hwvo/oDe5mfkZ3jBwdajIrKwKhTRSsko=";
})
];
nativeBuildInputs = [
pkg-config
pkgconfig
+1 -1
View File
@@ -26,7 +26,7 @@ let
libExt = stdenv.hostPlatform.extensions.sharedLibrary;
mytopEnv = buildPackages.perl.withPackages (p: with p; [ DBDmysql DBI TermReadKey ]);
mytopEnv = buildPackages.perl.withPackages (p: with p; [ DBDMariaDB DBI TermReadKey ]);
common = rec { # attributes common to both builds
inherit version;
+5
View File
@@ -12,6 +12,11 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ m4 ];
buildInputs = if stdenv.hostPlatform.isDarwin then [ Carbon IOKit ] else [ acl libcap ];
env.CFLAGS = toString [
"-Wno-error=implicit-int"
"-Wno-error=implicit-function-declaration"
];
postPatch = ''
sed "/\.mk3/d" -i libschily/Targets.man
substituteInPlace man/Makefile --replace "man4" ""
+17 -5
View File
@@ -7194,17 +7194,29 @@ with self; {
DBDmysql = buildPerlPackage {
pname = "DBD-mysql";
version = "4.050";
version = "5.010";
src = fetchurl {
url = "mirror://cpan/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz";
hash = "sha256-T0hUH/FaCnQF92rcEPgWJ8M5lvv1bJXCbAlERMCSjXg=";
url = "mirror://cpan/authors/id/D/DV/DVEEDEN/DBD-mysql-5.010.tar.gz";
hash = "sha256-LKL/Odk+idT3RG5fD68DgF6RZ+6bigS6fLJG4stG7uc=";
};
buildInputs = [ pkgs.libmysqlclient DevelChecklib TestDeep TestDistManifest TestPod ];
nativeBuildInputs = [
pkgs.mysql80 # for mysql_config
];
buildInputs = [
DevelChecklib
TestDeep
TestDistManifest
TestPod
pkgs.libmysqlconnectorcpp
pkgs.libxcrypt
pkgs.openssl
pkgs.zstd
];
propagatedBuildInputs = [ DBI ];
doCheck = false;
doCheck = false; # require running database
# makeMakerFlags = "MYSQL_HOME=${mysql}";
meta = {