Skip to contentSkip to conversation

configure: Look for .otf fonts

PATCH New Vladimir Serbinenko 1 participant 7 messages Sep 3, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/7 configure: Look for .otf fonts

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index d4a14bf93..fe5493246 100644
@@ -1875,7 +1875,7 @@ AC_ARG_WITH([unifont],
 
 if test "x$with_unifont" = x; then
   # search in well-known directories
-  for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
+  for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz otf otf.gz; do
     for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni /usr/share/fonts/truetype/unifont /usr/share/fonts/misc /usr/pkg/share/fonts/X11/misc /usr/local/share/fonts/gnu-unifont /usr/local/share/fonts/unifont; do
       if test -f "$dir/unifont.$ext"; then
         md5="$(md5sum "$dir/unifont.$ext"|awk '{ print $1; }')"
Signature · 7 lines
2.39.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#1 lore raw

PATCH v2 2/7 erofs: Replace 64-bit modulo with bitwise operations

Otherwise depending on compiler we end up with umoddi3 reference and failed module dependency resolution

---
 grub-core/fs/erofs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
grub-core/fs/erofs.c +2 -2
index 46cfc2e5c..f2a82e988 100644
@@ -357,13 +357,13 @@ erofs_map_blocks_flatmode (grub_fshelp_node_t node,
     {
       if (grub_add (erofs_iloc (node), erofs_inode_size (node), &map->m_pa) ||
 	  grub_add (map->m_pa, erofs_inode_xattr_ibody_size (node), &map->m_pa) ||
-	  grub_add (map->m_pa, map->m_la % blocksz, &map->m_pa))
+	  grub_add (map->m_pa, map->m_la & (blocksz - 1), &map->m_pa))
 	return grub_error (GRUB_ERR_OUT_OF_RANGE, "m_pa overflow when handling tailpacking");
       if (grub_sub (file_size, map->m_la, &map->m_plen))
 	return grub_error (GRUB_ERR_OUT_OF_RANGE, "m_plen overflow when handling tailpacking");
 
       /* No overflow as map->m_plen <= UINT64_MAX - blocksz + 1. */
-      if (((map->m_pa % blocksz) + map->m_plen) > blocksz)
+      if (((map->m_pa & (blocksz - 1)) + map->m_plen) > blocksz)
 	return grub_error (GRUB_ERR_BAD_FS,
                            "inline data cross block boundary @ inode %" PRIuGRUB_UINT64_T,
                            node->ino);
Signature · 7 lines
2.39.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#2 lore raw

PATCH v2 3/7 xzembed: Silence warning when no BCJ is available

In reply to Vladimir Serbinenko

BCJ is not available for all platforms hence arguments may end up unused

---
 grub-core/lib/xzembed/xz_dec_bcj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/lib/xzembed/xz_dec_bcj.c +1 -1
index bf6b5862e..aef4638d4 100644
@@ -353,7 +353,7 @@ static noinline_for_stack size_t bcj_sparc(
  * avoid pointers to static data (at least on x86).
  */
 static void bcj_apply(struct xz_dec_bcj *s,
-		uint8_t *buf, size_t *pos, size_t size)
+		      uint8_t *buf __attribute__((unused)), size_t *pos, size_t size __attribute__((unused)))
 {
 	size_t filtered;
 
Signature · 7 lines
2.39.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#3 lore raw

PATCH v2 4/7 configure: Add -mno-gpopt option

In reply to Vladimir Serbinenko

Without it compiler generates GPREL16 references which do not work with our memory layout

---
 configure.ac | 12 ++++++++++++
 1 file changed, 12 insertions(+)
configure.ac +12 -0
index fe5493246..c3d9398ab 100644
@@ -802,9 +802,21 @@ if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
   if test "x$grub_cv_cc_mflush_func" = xyes; then
     TARGET_CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring"
   fi
+
+  AC_CACHE_CHECK([whether -mno-gpopt works], [grub_cv_cc_mno_gpopt], [
+    CFLAGS="$TARGET_CFLAGS -mno-gpopt -Werror"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+        [grub_cv_cc_mno_gpopt=yes],
+	[grub_cv_cc_mno_gpopt=no])
+  ])
+
+  if test "x$grub_cv_cc_mno_gpopt" = xyes; then
+    TARGET_CFLAGS="$TARGET_CFLAGS -mno-gpopt"
+  fi
 fi
 
 
+
 # Force no alignment to save space on i386.
 if test "x$target_cpu" = xi386; then
   TARGET_CFLAGS="$TARGET_CFLAGS -falign-functions=1"
Signature · 7 lines
2.39.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#4 lore raw

PATCH v2 5/7 gentpl: Put startup_raw.S into beginning of the image

In reply to Vladimir Serbinenko

Otherwise it breaks the decompressors for mips platforms

---
 gentpl.py                   | 4 ++--
 grub-core/Makefile.core.def | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
gentpl.py +2 -2
index 3b12eca6c..d8c6965d8 100644
@@ -634,7 +634,7 @@ def extra_dist(defn):
 def extra_dep(defn):
     return foreach_value(defn, "depends", lambda value: value + " ")
 
-def platform_sources(defn, p): return platform_values(defn, p, "")
+def platform_sources(defn, p): return platform_values(defn, p, "_head") + platform_values(defn, p, "")
 def platform_nodist_sources(defn, p): return platform_values(defn, p, "_nodist")
 
 def platform_startup(defn, p): return platform_specific_values(defn, p, "_startup", "startup")
@@ -660,7 +660,7 @@ def first_time(defn, snippet):
 def is_platform_independent(defn):
     if 'enable' in defn:
         return False
-    for suffix in [ "", "_nodist" ]:
+    for suffix in [ "", "_head", "_nodist" ]:
         template = platform_values(defn, GRUB_PLATFORMS[0], suffix)
         for platform in GRUB_PLATFORMS[1:]:
             if template != platform_values(defn, platform, suffix):
grub-core/Makefile.core.def +2 -2
index 705d73fab..063ef5dd7 100644
@@ -536,7 +536,7 @@ image = {
 
 image = {
   name = xz_decompress;
-  mips = boot/mips/startup_raw.S;
+  mips_head = boot/mips/startup_raw.S;
   common = boot/decompressor/minilib.c;
   common = boot/decompressor/xz.c;
   common = lib/xzembed/xz_dec_bcj.c;
@@ -554,7 +554,7 @@ image = {
 
 image = {
   name = none_decompress;
-  mips = boot/mips/startup_raw.S;
+  mips_head = boot/mips/startup_raw.S;
   common = boot/decompressor/none.c;
 
   cppflags = '-DGRUB_EMBED_DECOMPRESSOR=1';
Signature · 7 lines
2.39.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#5 lore raw

PATCH v2 6/7 offsets: Set mod_align to 4 on mips

In reply to Vladimir Serbinenko

Module structure has natural alignment of 4. Respect it explicitly rather than relying on the fact that _end is usually aligned

---
 include/grub/offsets.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/grub/offsets.h +3 -3
index 871e1cd4c..442dc31de 100644
@@ -118,9 +118,9 @@
 #define GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN 3
 #define GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN (1 << GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN)
 
-#define GRUB_KERNEL_MIPS_LOONGSON_MOD_ALIGN 0x1
-#define GRUB_KERNEL_MIPS_ARC_MOD_ALIGN 0x1
-#define GRUB_KERNEL_MIPS_QEMU_MIPS_MOD_ALIGN 0x1
+#define GRUB_KERNEL_MIPS_LOONGSON_MOD_ALIGN 0x4
+#define GRUB_KERNEL_MIPS_ARC_MOD_ALIGN 0x4
+#define GRUB_KERNEL_MIPS_QEMU_MIPS_MOD_ALIGN 0x4
 
 #define GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN 	0x8
 #define GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE	0x4
Signature · 7 lines
2.39.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#6 lore raw

PATCH v2 7/7 mkimage: Explicitly move modules to __bss_start

In reply to Vladimir Serbinenko

Assembly code looks for modules at __bss_start. Make this position explicit rather than matching bss alignment and module alignment.

---
 util/grub-mkimagexx.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
util/grub-mkimagexx.c +18 -0
index e50b29533..fe6085c8b 100644
@@ -2431,6 +2431,8 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path,
   if (!is_relocatable (image_target))
     {
       Elf_Addr current_address = layout->kernel_size;
+      Elf_Addr bss_start = layout->kernel_size;
+      bool is_first = true;
 
       for (i = 0, s = smd.sections;
 	   i < smd.num_sections;
@@ -2453,6 +2455,12 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path,
 	      current_address = grub_host_to_target_addr (s->sh_addr)
 		- image_target->link_addr;
 
+	    if (is_first)
+	      {
+		bss_start = current_address;
+		is_first = false;
+	      }
+
 	    smd.vaddrs[i] = current_address
 	      + image_target->vaddr_offset;
 	    current_address += grub_host_to_target_addr (s->sh_size);
@@ -2460,6 +2468,16 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path,
       current_address = ALIGN_UP (current_address + image_target->vaddr_offset,
 				  image_target->section_align)
 	- image_target->vaddr_offset;
+
+      if (image_target->id == IMAGE_YEELOONG_FLASH
+	  || image_target->id == IMAGE_FULOONG2F_FLASH
+	  || image_target->id == IMAGE_LOONGSON_ELF
+	  || image_target->id == IMAGE_QEMU_MIPS_FLASH
+	  || image_target->id == IMAGE_MIPS_ARC)
+	{
+	  layout->kernel_size = bss_start;
+	}
+
       layout->bss_size = current_address - layout->kernel_size;
     }
   else
Signature · 7 lines
2.39.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel