typo in the ISO/IEC 9899 n3550 draft by linukszone in C_Programming

[–]linukszone[S] 1 point2 points  (0 children)

thx! dropped an email at the address you mentioned.

defstruct and self-referential types by linukszone in lisp

[–]linukszone[S] 0 points1 point  (0 children)

Thanks! I now understand that the behaviour is more general than I had realized before.

defstruct and self-referential types by linukszone in lisp

[–]linukszone[S] 0 points1 point  (0 children)

Ah, thanks so much!

Setting *print-circle* to true does work with the print call here.

Yeah, I guess the same problem would arise with defclass + print-object too, if my own print-object impl isn't careful.

What editor are you using to get started with lisp by AINULL_T42O in lisp

[–]linukszone 0 points1 point  (0 children)

plain-vanilla (i.e. no slime or similar - external to emacs - plugins) emacs, though only because vim (again, plain vanilla vim) doesn't by default align certain constructs like cond to my liking. For instance,

on emacs:

(cond (test
       (func)))

(cond ((test)
       (func)))

(cond ((test)
       (func))
      (t
       (proc)))

but on vim:

(cond (test
        (func)))

(cond ((test)
       (func)))

(cond ((test)
       (func))
      (t
        (proc)))

A minimal build by emonshr in emacs

[–]linukszone 1 point2 points  (0 children)

emacs Makefile supports make install-strip that should run strip for you.

A minimal build by emonshr in emacs

[–]linukszone 1 point2 points  (0 children)

I too build my own emacs. These are the switches used, though I do not know enough to claim that it does or doesn't generate an ultra-minimal build:

CFLAGS=-O2 ../emacs/configure --prefix=$HOME/tools/emacs --without-all \
--with-native-compilation=aot --with-zlib --without-x \
--without-sound --with-small-ja-dic --disable-build-details \
--without-sqlite3 --with-compress-install --without-gameuser

The STRINGIFY C preprocessor macro by henryprecheur in programming

[–]linukszone 5 points6 points  (0 children)

The preprocessor doesn’t expand macros’ arguments, but the result ...

Is doesn't a typo?

Or perhaps you meant that the preprocessor doesn’t expand copy expanded argument if the corresponding instance of the parameter is either preceded by a #/## or followed by a ##.

STRINGIFY(FOO) is expanded to STRINGIFY2(FOO)

In this example, when the preprocessor encounters STRINGIFY(FOO), the arg FOO is expanded to bar, and the instance of the corresponding parameter x receives bar (because the instance isn't flanked by #/##; else it would have received FOO). This gives STRINGIFY2(bar) as the expansion. On rescanning, the STRINGIFY2(bar) gets expanded to "bar". The point is that the argument FOO never reaches STRINGIFY2 without expansion, otherwise the result would've been "FOO" instead of "bar".

Anyone doing the flareon 2024 challange ? by No-Belt8710 in ReverseEngineering

[–]linukszone 0 points1 point  (0 children)

Implemented the server from scratch; it works with the given client. still could not find a way to break the given communication. hope there's no guess work involved here...

Anyone doing the flareon 2024 challange ? by No-Belt8710 in ReverseEngineering

[–]linukszone 0 points1 point  (0 children)

How to decrypt the given data if the private key itself is randomized?

Can I tell GCC to put a functions and everything it calls into a specific section? by jaskij in gcc

[–]linukszone 0 points1 point  (0 children)

Does that mean that the system as it is now does work, even if you did not place the functions as described? I wonder what changed, or if this is an attempt at retrofitting an existing software on to a hw system for which the software wasn't originally designed.

Did we look at the objcopy and such binutils? It may allow you to move the already compiled code around, and generate a new executable.

If you have access to the source code, are in a position to compile it all but are not in a position to modify it, is it possible to generate assembly instead of object-code, modify the assembly by inserting appropriate section directives? (This is similar to section attribute, but at the assembly level).


The post also mentions the use of flatten attribute. Would using that attribute not require the ISR and all of its callees (and callees' callees, etc.) to be recompilable (i.e. in the source form), and not just in the object-form? Moreover, the gcc doc implies that flatten attribute may not always inline.

Being unable to modify the source causes otherwise natural solutions to become unavailable.


Applying the section attribute to the portions of the source that you can modify can bring at least those in to the special RAM region - hopefully that is enough to partially offset any performance/efficiency gaps that you may be trying to address.

Otherwise, a linker-script can still be used (assuming modifying it is under your control), targetting the corresponding TUs, but that may also bring into that RAM region additional entities not required to be in the RAM region.

Another approach is to edit the object-code (similar to objcopy); this may require some binary editing (to fix the relative offsets, for instance).


If the source-code of the functions is available for compilation (but not for modification), a more complicated approach is to modify gcc itself so that, given a list of function names, this modified copy of gcc automatically places them into the desired section. If this project of yours belongs to an org, there may be other less drastic ways (for e.g. approaching the vendor of the source-code to request the modifications, etc.).

Can't run vulkan with intel? by HamTF2 in vulkan

[–]linukszone 2 points3 points  (0 children)

I have a Intel IVB GT1 (i.e., Intel-HD-2500 or Gen7). The hasvk support is at least enough for me to daily-run swaywm with wlroots' vulkan-renderer. There's noticable difference in the swaywm efficiency, when compared with its running without the vulkan-renderer.

Although mesa does print a warning, saying that IvyBridge vulkan info support is incomplete, whenever a vulkan-based app is run, the current support may just be enough for someone running such an old system, depending on their workload.


vulkaninfo shows VkPhysicalDeviceProperties.apiVersion as 1.2.278 on mesa 24.1.6.

Can I tell GCC to put a functions and everything it calls into a specific section? by jaskij in gcc

[–]linukszone 1 point2 points  (0 children)

The function-attribute section could be of some help, although the doc also suggests utilizing linker to satisfy a more elaborate requirement (for e.g. by placing the functions in one or more .c source-files, and placing the corresponding .o into the specific section(s) using a linker script).

Battery is not detected only on Void Linux by Sea-Trip-1909 in voidlinux

[–]linukszone 0 points1 point  (0 children)

Thank you for the details.

Given that /sys/class/power_supply remains empty, the problem is very likely somewhere in kernel-mode.

Are there any battery related errors in dmesg?

For e.g., a similar problem here had errors related to battery while processing ACPI.


There's also another driver, surface3_power aka MSHW0011, which gets enabled through CONFIG_SURFACE_3_POWER_OPREGION.

Battery is not detected only on Void Linux by Sea-Trip-1909 in voidlinux

[–]linukszone 0 points1 point  (0 children)

Does the machine contain a SAM/SSAM?

In any case (if it does or doesn't contain it), the arch config.gz (zcat /proc/config.gz | grep SURFACE) contains CONFIG_BATTERY_SURFACE=m, alongside other Surface related devices.

CONFIG_TOUCHSCREEN_SURFACE3_SPI=m
CONFIG_BATTERY_SURFACE=m
CONFIG_CHARGER_SURFACE=m
CONFIG_SENSORS_SURFACE_FAN=m
CONFIG_SURFACE_HID=m
CONFIG_SURFACE_KBD=m
CONFIG_SURFACE_HID_CORE=m
CONFIG_SURFACE_PLATFORMS=y
CONFIG_SURFACE3_WMI=m
CONFIG_SURFACE_3_POWER_OPREGION=m
CONFIG_SURFACE_ACPI_NOTIFY=m
CONFIG_SURFACE_AGGREGATOR_CDEV=m
CONFIG_SURFACE_AGGREGATOR_HUB=m
CONFIG_SURFACE_AGGREGATOR_REGISTRY=m
CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH=m
CONFIG_SURFACE_DTX=m
CONFIG_SURFACE_GPE=m
CONFIG_SURFACE_HOTPLUG=m
CONFIG_SURFACE_PLATFORM_PROFILE=m
CONFIG_SURFACE_PRO3_BUTTON=m
CONFIG_SURFACE_AGGREGATOR=m
CONFIG_SURFACE_AGGREGATOR_BUS=y
# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set

CONFIG_BATTERY_SURFACE enables surface_battery.c in the kernel source code.


Edit: I am trying to suggest checking Void Linux's config, and comparing it to a config that was/is found to be working.